Bulk Delete
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({business_travel_ids: {}})
};
fetch('https://api.dcycle.io/v1/business-travels/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/business-travels/bulk-delete"
payload = { "business_travel_ids": {} }
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v1/business-travels/bulk-delete \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"business_travel_ids": {}
}
'{
"success_count": 123,
"success_ids": {},
"failed_count": 123,
"failed_ids": {},
"message": "<string>"
}Bulk Delete
Delete multiple business travel records and their associated emissions in a single request
POST
/
v1
/
business-travels
/
bulk-delete
Bulk Delete
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({business_travel_ids: {}})
};
fetch('https://api.dcycle.io/v1/business-travels/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/business-travels/bulk-delete"
payload = { "business_travel_ids": {} }
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v1/business-travels/bulk-delete \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"business_travel_ids": {}
}
'{
"success_count": 123,
"success_ids": {},
"failed_count": 123,
"failed_ids": {},
"message": "<string>"
}← Business Travels API
Permanently deletes multiple business travel records and their associated
total_impacts rows in a single request. Records that belong to a different organization are reported as failed rather than raising an error. Progress is tracked via a processing job.
Permanent Action: Deleted records cannot be recovered. The associated emissions data will also be removed from your organization’s totals.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51fastring
required
Must be
application/jsonBody Parameters
array[uuid]
required
List of business travel UUIDs to deleteConstraints: 1 to 100,000 items per request
Response
integer
Number of items successfully deleted
array[string]
UUIDs of business travels that were successfully deleted
integer
Number of items that failed to delete
array[string]
UUIDs that could not be deleted (not found, belong to a different organization, or deletion error)
string
Human-readable summary message
Example
curl -X POST "https://api.dcycle.io/v1/business-travels/bulk-delete" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{
"business_travel_ids": [
"550e8400-e29b-41d4-a716-446655440000",
"550e8400-e29b-41d4-a716-446655440001"
]
}'
import requests
import os
response = requests.post(
"https://api.dcycle.io/v1/business-travels/bulk-delete",
headers={
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
},
json={
"business_travel_ids": [
"550e8400-e29b-41d4-a716-446655440000",
"550e8400-e29b-41d4-a716-446655440001",
]
},
)
result = response.json()
print(f"Deleted: {result['success_count']}, Failed: {result['failed_count']}")
print(result["message"])
const axios = require('axios');
axios.post(
'https://api.dcycle.io/v1/business-travels/bulk-delete',
{
business_travel_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(({ data }) => {
console.log(`Deleted: ${data.success_count}, Failed: ${data.failed_count}`);
console.log(data.message);
})
.catch(error => console.error(error));
Successful Response
{
"success_count": 1,
"success_ids": ["550e8400-e29b-41d4-a716-446655440000"],
"failed_count": 1,
"failed_ids": ["550e8400-e29b-41d4-a716-446655440001"],
"message": "Bulk delete completed: 1 deleted, 1 failed"
}
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 list or exceeds 100,000 items{
"detail": [
{
"loc": ["body", "business_travel_ids"],
"msg": "ensure this value has at least 1 items",
"type": "value_error.list.min_items"
}
]
}
Related Endpoints
Delete
Delete a single business travel
Bulk Delete by Filters
Delete all records matching filter criteria
List Business Travels
Browse all business travels
Was this page helpful?