Skip to main content
GET
/
v1
/
hotel-stays
/
{hotel_stay_id}
Get Hotel Stay
const options = {
  method: 'GET',
  headers: {Authorization: '<authorization>', 'x-organization-id': '<x-organization-id>'}
};

fetch('https://api.dcycle.io/v1/hotel-stays/{hotel_stay_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "<string>",
  "organization_id": "<string>",
  "name": {},
  "check_in_date": "<string>",
  "check_out_date": "<string>",
  "country": "<string>",
  "city": {},
  "hotel_name": {},
  "rooms": 123,
  "status": "<string>",
  "source": {},
  "co2e": {},
  "file_id": {},
  "file_name": {},
  "created_at": {},
  "updated_at": {},
  "uploaded_by": {
    "id": "<string>",
    "first_name": {},
    "last_name": {},
    "profile_img_url": {}
  }
}

Get Hotel Stay

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

Request

Headers

Authorization
string
required
Bearer token for authenticationExample: Bearer sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Path Parameters

hotel_stay_id
string
required
The unique identifier (UUID) of the hotel stay recordExample: 550e8400-e29b-41d4-a716-446655440000

Response

id
string
Unique identifier (UUID)
organization_id
string
Organization UUID this stay belongs to
name
string | null
Free-text description of the stay
check_in_date
date
Check-in date
check_out_date
date
Check-out date
country
string
ISO-3166 alpha-2 country code (e.g. ES, GB, US)
city
string | null
City where the hotel is located
hotel_name
string | null
Hotel name
rooms
integer
Number of rooms booked
status
string
active, pending, or error
source
string | null
How the record was created (manual, bulk_upload, etc.)
co2e
number | null
Calculated CO2e in kg (sourced from total_impacts, not stored on the record)
file_id
string | null
UUID of the source bulk-upload file, if any
file_name
string | null
Name of the source file, if any
created_at
datetime
Record creation timestamp
updated_at
datetime
Last update timestamp
uploaded_by
object | null
User who created the record

Example

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}"

Successful Response

{
  "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.
{
  "detail": "Hotel stay not found",
  "code": "HOTEL_STAY_NOT_FOUND"
}

List Hotel Stays

Get all hotel stays with filtering

Impact Calculation

Step-by-step CO2e breakdown

Delete Hotel Stay

Remove this record