> ## Documentation Index
> Fetch the complete documentation index at: https://code.dcycle.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Hotel Stay

> Retrieve a specific hotel stay record by ID

# Get Hotel Stay

Retrieve detailed information about a specific hotel stay record by its unique identifier.

## Request

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication

  **Example:** `Bearer sk_live_1234567890abcdef`
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID

  **Example:** `a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

### Path Parameters

<ParamField path="hotel_stay_id" type="string" required>
  The unique identifier (UUID) of the hotel stay record

  **Example:** `550e8400-e29b-41d4-a716-446655440000`
</ParamField>

## Response

<ResponseField name="id" type="string">
  Unique identifier (UUID)
</ResponseField>

<ResponseField name="organization_id" type="string">
  Organization UUID this stay belongs to
</ResponseField>

<ResponseField name="name" type="string | null">
  Free-text description of the stay
</ResponseField>

<ResponseField name="check_in_date" type="date">
  Check-in date
</ResponseField>

<ResponseField name="check_out_date" type="date">
  Check-out date
</ResponseField>

<ResponseField name="country" type="string">
  ISO-3166 alpha-2 country code (e.g. `ES`, `GB`, `US`)
</ResponseField>

<ResponseField name="city" type="string | null">
  City where the hotel is located
</ResponseField>

<ResponseField name="hotel_name" type="string | null">
  Hotel name
</ResponseField>

<ResponseField name="rooms" type="integer">
  Number of rooms booked
</ResponseField>

<ResponseField name="status" type="string">
  `active`, `pending`, or `error`
</ResponseField>

<ResponseField name="source" type="string | null">
  How the record was created (`manual`, `bulk_upload`, etc.)
</ResponseField>

<ResponseField name="co2e" type="number | null">
  Calculated CO2e in kg (sourced from total\_impacts, not stored on the record)
</ResponseField>

<ResponseField name="file_id" type="string | null">
  UUID of the source bulk-upload file, if any
</ResponseField>

<ResponseField name="file_name" type="string | null">
  Name of the source file, if any
</ResponseField>

<ResponseField name="created_at" type="datetime">
  Record creation timestamp
</ResponseField>

<ResponseField name="updated_at" type="datetime">
  Last update timestamp
</ResponseField>

<ResponseField name="uploaded_by" type="object | null">
  User who created the record

  <Expandable title="User Object">
    <ResponseField name="id" type="string">UUID</ResponseField>
    <ResponseField name="first_name" type="string | null">First name</ResponseField>
    <ResponseField name="last_name" type="string | null">Last name</ResponseField>
    <ResponseField name="profile_img_url" type="string | null">Profile image URL</ResponseField>
  </Expandable>
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X GET "https://api.dcycle.io/v1/hotel-stays/550e8400-e29b-41d4-a716-446655440000" \
    -H "Authorization: Bearer ${DCYCLE_API_KEY}" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests
  import os

  response = requests.get(
      "https://api.dcycle.io/v1/hotel-stays/550e8400-e29b-41d4-a716-446655440000",
      headers={
          "Authorization": f"Bearer {os.getenv('DCYCLE_API_KEY')}",
          "x-organization-id": os.getenv("DCYCLE_ORG_ID")
      }
  )
  stay = response.json()
  print(f"{stay['hotel_name']} ({stay['country']}): {stay['co2e']} kg CO2e")
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const axios = require('axios');

  axios.get(
    'https://api.dcycle.io/v1/hotel-stays/550e8400-e29b-41d4-a716-446655440000',
    {
      headers: {
        'Authorization': `Bearer ${process.env.DCYCLE_API_KEY}`,
        'x-organization-id': process.env.DCYCLE_ORG_ID
      }
    }
  )
  .then(r => console.log(r.data))
  .catch(error => console.error(error));
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
  "name": "Team offsite — Madrid",
  "check_in_date": "2024-11-04",
  "check_out_date": "2024-11-07",
  "country": "ES",
  "city": "Madrid",
  "hotel_name": "Hotel Gran Vía",
  "rooms": 3,
  "status": "active",
  "source": "manual",
  "co2e": 18.54,
  "file_id": null,
  "file_name": null,
  "created_at": "2024-11-01T09:00:00Z",
  "updated_at": "2024-11-01T09:00:00Z",
  "uploaded_by": {
    "id": "b9f1e2d3-0000-0000-0000-000000000001",
    "first_name": "Ana",
    "last_name": "García",
    "profile_img_url": null
  }
}
```

## Common Errors

### 404 Not Found

**Cause:** The hotel stay ID does not exist or belongs to a different organization.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "detail": "Hotel stay not found",
  "code": "HOTEL_STAY_NOT_FOUND"
}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="List Hotel Stays" icon="list" href="/api-reference/hotel-stays/list">
    Get all hotel stays with filtering
  </Card>

  <Card title="Impact Calculation" icon="calculator" href="/api-reference/hotel-stays/impact-calculation">
    Step-by-step CO2e breakdown
  </Card>

  <Card title="Delete Hotel Stay" icon="trash" href="/api-reference/hotel-stays/delete">
    Remove this record
  </Card>
</CardGroup>
