Skip to main content
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));
{
  "success_count": 123,
  "success_ids": {},
  "failed_count": 123,
  "failed_ids": {},
  "message": "<string>"
}

Bulk Delete

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

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa
Content-Type
string
required
Must be application/json

Body Parameters

business_travel_ids
array[uuid]
required
List of business travel UUIDs to deleteConstraints: 1 to 100,000 items per request

Response

success_count
integer
Number of items successfully deleted
success_ids
array[string]
UUIDs of business travels that were successfully deleted
failed_count
integer
Number of items that failed to delete
failed_ids
array[string]
UUIDs that could not be deleted (not found, belong to a different organization, or deletion error)
message
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"
    ]
  }'

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

Delete

Delete a single business travel

Bulk Delete by Filters

Delete all records matching filter criteria

List Business Travels

Browse all business travels