Skip to main content
POST
Bulk Delete Vehicles by Filters

Bulk Delete Vehicles by Filters

Delete all vehicles that match a set of filter criteria. This endpoint uses a two-step workflow: first fetch the vehicle list with filters applied (which returns a filter_hash), then call this endpoint with that hash to confirm you are deleting exactly what you saw.
Permanent Action: Deleting vehicles is permanent and cannot be undone. All associated consumption records and emissions data will be removed from your organization’s totals.

How It Works

  1. Call GET /v1/vehicles with your desired filters — the response includes a filter_hash field.
  2. Call this endpoint with the same query filters and pass the filter_hash in the request body.
  3. 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 vehicle list response. Confirms you are deleting exactly the records you saw.Example: "a3f1c2e4b5d6a7b8"

Query Parameters

At least one filter parameter is required.
Text search across vehicle fields (e.g. license plate, name)
array[string]
Filter by vehicle statusAvailable values: active, archived, errorExample: status[]=active&status[]=archived
array[string]
Filter by vehicle ownership typeAvailable values: owned, rentedExample: ownership[]=owned
array[string]
Filter by unknown vehicle UUIDs
array[string]
Filter by fuel type UUIDs
array[string]
Filter by source file UUIDs (e.g. to delete all vehicles imported from a specific file)
string
Filter vehicles created on or after this datetime (ISO 8601)Example: 2024-01-01T00:00:00Z
string
Filter vehicles created on or before this datetime (ISO 8601)Example: 2024-12-31T23:59:59Z
boolean
default:"false"
Include vehicles from child organizations

Response

Returns 200 OK with a JSON summary of the operation.
integer
Number of vehicles successfully deleted
array[string]
UUIDs of successfully deleted vehicles
integer
Number of vehicles that failed to delete
array[string]
UUIDs of vehicles that failed to delete
string
Human-readable summary of the operation

Example

Successful Response

Common Errors

401 Unauthorized

Cause: Missing or invalid API key

409 Conflict — Filter Hash Mismatch

Cause: The filter_hash does not match the current filter results. The underlying data changed between the list call and the delete call.
Solution: Re-fetch the vehicle list with the same filters to get a fresh 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)

List Vehicles

Retrieve vehicles and obtain the filter_hash

Bulk Delete Vehicles

Delete specific vehicles by ID

Bulk Delete Consumptions by Filters

Delete consumption records matching filters

Delete Vehicle

Delete a single vehicle