← Vehicles APIDelete every consumption record across the organization that matches a set of filter criteria — most commonly file_id[], to remove every consumption created from one bulk upload, across every vehicle it was split into. Uses the same two-step, hash-confirmed workflow as the per-vehicle equivalent.
Permanent Action: Deleting consumption records is permanent and cannot be undone. All associated emissions data will be removed from your organization’s totals.
Single organization only: This endpoint never reaches into child organizations of a holding. If a parent-company file was split across several organizations (not just several vehicles in one organization), each organization’s consumptions must be deleted separately.
How It Works
Call GET /v2/vehicle_consumptions with your desired filters — the response includes a filter_hash field.
Call this endpoint with the same query filters and pass the filter_hash in the request body.
The API verifies the hash matches the current filter results to prevent stale-data race conditions.
Request
Headers
string
required
Your API key for authenticationExample:sk_live_1234567890abcdef
string
required
Your organization UUIDExample:a8315ef3-dd50-43f8-b7ce-d839e68d51fa
Body Parameters
string
required
The hash returned in the filter_hash field of the list response. Confirms you are deleting exactly the records you saw.Example:"b4c2d3e5f6a7b8c9"
Query Parameters
No filter is required: without one the delete covers every consumption the unfiltered list shows (the header organization, or under group view the accepted family narrowed by organization_id[], and the project scope when it is on).
array[string]
Narrow the deletion to specific vehicle UUIDs
array[string]
Filter by consumption statusAvailable values:active, success, loading, error
array[string]
Filter by fuel unit UUIDs
array[string]
Filter by the fuel UUIDs stamped on the consumption
string
Filter by custom identifier
string
Filter consumptions with a start date on or after this date (YYYY-MM-DD)
string
Filter consumptions with an end date on or before this date (YYYY-MM-DD)
array[string]
Filter by source file UUIDs — delete every consumption imported from a specific file, across all vehicles it was split intoExample:file_id[]=880e8400-e29b-41d4-a716-446655440000
string
Filter consumptions created on or after this datetime (ISO 8601)
string
Filter consumptions created on or before this datetime (ISO 8601)
string
Filter by CO2e calculation statusAvailable values:calculated, not_calculated
Response
Returns 200 OK with a JSON summary of the operation.
integer
Number of consumption records successfully deleted
array[string]
UUIDs of successfully deleted consumption records
integer
Number of records that failed to delete
array[string]
UUIDs of records that failed to delete
string
Human-readable summary of the operation
Example
# Step 1: get list with filters to obtain filter_hashcurl -X GET "https://api.dcycle.io/v2/vehicle_consumptions?file_id[]=880e8400-e29b-41d4-a716-446655440000" \ -H "x-api-key: ${DCYCLE_API_KEY}" \ -H "x-organization-id: ${DCYCLE_ORG_ID}"# Step 2: bulk delete using the filter_hash from the list responsecurl -X POST "https://api.dcycle.io/v2/vehicle_consumptions/bulk-delete-by-filters?file_id[]=880e8400-e29b-41d4-a716-446655440000" \ -H "x-api-key: ${DCYCLE_API_KEY}" \ -H "x-organization-id: ${DCYCLE_ORG_ID}" \ -H "Content-Type: application/json" \ -d '{"filter_hash": "b4c2d3e5f6a7b8c9"}'