Bulk Delete Vehicle Consumptions by Filters (Organization)
Bulk Delete Vehicle Consumptions by Filters (Organization)
Delete every consumption record in the organization matching a set of filter criteria, e.g. an entire uploaded file
POST
Bulk Delete Vehicle Consumptions by Filters (Organization)
Bulk Delete Vehicle Consumptions by Filters (Organization)
Delete every consumption record across the organization that matches a set of filter criteria — most commonlyfile_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.
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_consumptionswith your desired filters — the response includes afilter_hashfield. - Call this endpoint with the same query filters and pass the
filter_hashin the request body. - The API verifies the hash matches the current filter results to prevent stale-data race conditions.
Request
Headers
Your API key for authenticationExample:
sk_live_1234567890abcdefYour organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faBody Parameters
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
At least one filter parameter is required — a bare “delete everything” is rejected.Narrow the deletion to specific vehicle UUIDs
Filter by consumption statusAvailable values:
active, success, loading, errorFilter by fuel unit UUIDs
Filter by custom identifier
Filter consumptions with a start date on or after this date (YYYY-MM-DD)
Filter consumptions with an end date on or before this date (YYYY-MM-DD)
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-446655440000Filter consumptions created on or after this datetime (ISO 8601)
Filter consumptions created on or before this datetime (ISO 8601)
Filter by CO2e calculation statusAvailable values:
calculated, not_calculatedResponse
Returns200 OK with a JSON summary of the operation.
Number of consumption records successfully deleted
UUIDs of successfully deleted consumption records
Number of records that failed to delete
UUIDs of records that failed to delete
Human-readable summary of the operation
Example
Successful Response
Common Errors
401 Unauthorized
Cause: Missing or invalid API key409 Conflict — Filter Hash Mismatch
Cause: Thefilter_hash does not match the current filter results. The underlying data changed between the list call and the delete call.
filter_hash, then retry.
422 Unprocessable Entity — No Filters Provided
Cause: No filter query parameters were supplied. At least one filter is required to prevent accidental mass deletion.422 Validation Error
Cause: Invalid query parameter value (e.g. unknown status enum)Related Endpoints
List Vehicle Consumptions (Organization)
List consumptions and obtain the filter_hash
Unique Values (Organization)
Get the list of source files to filter by
Bulk Delete (Organization)
Delete specific consumption records by ID
Bulk Delete Consumptions by Filters
The single-vehicle equivalent of this endpoint

