Bulk Delete Hotel Stays
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({hotel_stay_ids: {}})
};
fetch('https://api.dcycle.io/v1/hotel-stays/bulk-delete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/hotel-stays/bulk-delete"
payload = { "hotel_stay_ids": {} }
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v1/hotel-stays/bulk-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"hotel_stay_ids": {}
}
'{
"deleted": {},
"failed": {}
}Bulk Delete Hotel Stays
Delete multiple hotel stay records and their associated emissions in a single request
POST
/
v1
/
hotel-stays
/
bulk-delete
Bulk Delete Hotel Stays
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({hotel_stay_ids: {}})
};
fetch('https://api.dcycle.io/v1/hotel-stays/bulk-delete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/hotel-stays/bulk-delete"
payload = { "hotel_stay_ids": {} }
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v1/hotel-stays/bulk-delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"hotel_stay_ids": {}
}
'{
"deleted": {},
"failed": {}
}← Hotel Stays API
Permanently deletes multiple hotel stay records and their associated
total_impacts rows in a single request. Stays that belong to a different organization are reported as failed rather than raising an error.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faBody
array[string]
required
List of hotel stay UUIDs to deleteExample:
["550e8400-e29b-41d4-a716-446655440000", "550e8400-e29b-41d4-a716-446655440001"]Response
array[string]
UUIDs of hotel stays that were successfully deleted
array[string]
UUIDs that could not be deleted (not found or belong to a different organization)
Example
curl -X POST "https://api.dcycle.io/v1/hotel-stays/bulk-delete" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{
"hotel_stay_ids": [
"550e8400-e29b-41d4-a716-446655440000",
"550e8400-e29b-41d4-a716-446655440001"
]
}'
import requests
import os
response = requests.post(
"https://api.dcycle.io/v1/hotel-stays/bulk-delete",
headers={
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID")
},
json={
"hotel_stay_ids": [
"550e8400-e29b-41d4-a716-446655440000",
"550e8400-e29b-41d4-a716-446655440001"
]
}
)
result = response.json()
print(f"Deleted: {result['deleted']}")
print(f"Failed: {result['failed']}")
const axios = require('axios');
axios.post(
'https://api.dcycle.io/v1/hotel-stays/bulk-delete',
{
hotel_stay_ids: [
'550e8400-e29b-41d4-a716-446655440000',
'550e8400-e29b-41d4-a716-446655440001'
]
},
{
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID
}
}
)
.then(r => {
console.log('Deleted:', r.data.deleted);
console.log('Failed:', r.data.failed);
})
.catch(error => console.error(error));
Successful Response
{
"deleted": [
"550e8400-e29b-41d4-a716-446655440000"
],
"failed": [
"550e8400-e29b-41d4-a716-446655440001"
]
}
Common Errors
401 Unauthorized
Cause: Missing or invalid API key{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
403 Forbidden
Cause: The authenticated user is not a member of the organization{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
422 Unprocessable Entity
Cause: Empty or invalid hotel_stay_ids array{
"detail": [
{
"loc": ["body", "hotel_stay_ids"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Related Endpoints
Delete Hotel Stay
Delete a single hotel stay
List Hotel Stays
Browse all hotel stays
Was this page helpful?