Bulk Delete Vehicle Consumptions by Filters
Bulk Delete Vehicle Consumptions by Filters
Delete all consumption records for a vehicle matching the given filter criteria
POST
Bulk Delete Vehicle Consumptions by Filters
Bulk Delete Vehicle Consumptions by Filters
Delete all consumption records for a specific vehicle that match a set of filter criteria. This endpoint uses a two-step workflow: first fetch the consumption list with filters applied (which returns afilter_hash), then call this endpoint with that hash to confirm you are deleting exactly what you saw.
How It Works
- Call
GET /v1/vehicles/{vehicle_id}/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
Path Parameters
uuid
required
The UUID of the vehicle whose consumptions you want to deleteExample:
550e8400-e29b-41d4-a716-446655440000Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faBody Parameters
string
required
The hash returned in the
filter_hash field of the consumption list response. Confirms you are deleting exactly the records you saw.Example: "b4c2d3e5f6a7b8c9"Query Parameters
At least one filter parameter is required.array[string]
Filter by consumption statusAvailable values:
active, success, loading, errorExample: status[]=error&status[]=loadingarray[string]
Filter by unit UUIDs
string
Filter by custom identifier
string
Filter consumptions with a start date on or after this date (YYYY-MM-DD)Example:
2024-01-01string
Filter consumptions with an end date on or before this date (YYYY-MM-DD)Example:
2024-12-31array[string]
Filter by source file UUIDs (e.g. to delete all consumptions imported from a specific file)
string
Filter consumptions created on or after this datetime (ISO 8601)Example:
2024-01-01T00:00:00Zstring
Filter consumptions created on or before this datetime (ISO 8601)Example:
2024-12-31T23:59:59Zstring
Filter by CO2e calculation statusAvailable values:
calculated, not_calculatedExample: co2e_status=not_calculatedResponse
Returns200 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
Successful Response
Common Errors
401 Unauthorized
Cause: Missing or invalid API key404 Not Found
Cause: Vehicle not found in organization409 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
Vehicle Consumptions
List consumptions and obtain the filter_hash
Bulk Delete Consumptions
Delete specific consumption records by ID
Bulk Delete Vehicles by Filters
Delete vehicles matching filter criteria
Delete Vehicle
Delete a single vehicle
Bulk Delete by Filters (Organization)
Delete consumptions matching filters across every vehicle in the organization