Bulk Delete Business Travels
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: {}, delete_source_files: true})
};
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": {},
"delete_source_files": True
}
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": {},
"delete_source_files": true
}
'{
"success_count": 123,
"success_ids": {},
"failed_count": 123,
"failed_ids": {},
"message": "<string>"
}Bulk Delete Business Travels
Delete multiple business travel records and their associated emissions in a single request
POST
/
v1
/
business-travels
/
bulk-delete
Bulk Delete Business Travels
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: {}, delete_source_files: true})
};
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": {},
"delete_source_files": True
}
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": {},
"delete_source_files": true
}
'{
"success_count": 123,
"success_ids": {},
"failed_count": 123,
"failed_ids": {},
"message": "<string>"
}← Business Travels API
Permanently deletes multiple business travel records and their associated
Deprecated. Use
POST /v2/business-travels/delete: up to 5,000
business travels per request, idempotent, deleted asynchronously, with webhooks. To also move to the trash the uploaded files that no record uses after the delete (delete_source_files), use this endpoint: the v2 delete does not. This endpoint keeps working; its
responses carry Deprecation and Link: </v2/business-travels/delete>; rel="successor-version" headers. Its
responses also carry Sunset: Fri, 30 Apr 2027 00:00:00 GMT: the endpoint is retired on April 30, 2027 (see the
changelog).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
Body Parameters
List of business travel UUIDs to deleteConstraints: 1 to 100,000 items per request
Also move to the trash the files uploaded for these records that no record uses after the delete.
Response
UUIDs that could not be deleted (not found, belong to a different organization, or deletion error)
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?