Skip to main content
GET
List Consumption Filter Values
← Vehicles API Get the distinct values a field takes across one vehicle’s consumption records, each with the number of records that use it. This is what you call to build a filter dropdown that only offers values that actually exist — instead of showing every option and letting the user pick one that returns nothing.
This endpoint is scoped to a single vehicle, named in the path. To cover every vehicle at once use the organization-wide version, List Consumption Filter Values (Organization) — same query parameter, same response shape, no path id.

Request

Headers

string
required
UUID of the organization the vehicle belongs to.Format: UUID
string
Your API key.

Path Parameters

string
required
UUID of the vehicle whose consumptions you are filtering.The vehicle is resolved across the consolidated organization family — the header organization and its subsidiaries — so a holding can filter a subsidiary’s consumptions. A vehicle outside that perimeter returns 404, never 403.

Query Parameters

string
required
The field to list values for. Two values are accepted:
  • file_id — the source files consumptions were imported from
  • vehicle_id — the vehicles the records belong to
Any other value is rejected with 422, so this is a closed list rather than a free-text field.

Response

string
The field that was queried, echoed back.
integer
How many distinct values were found.
array[object]
The distinct values, each with its record count.
Records with no source file come back as the zero UUID, not as null. A file_id that is empty in the database is serialised as 00000000-0000-0000-0000-000000000000, with its own count. Treat that value as “no file” rather than as a real file id — there is no null bucket to guard for.

Example

Successful Response

Returns 200 OK.

Common Errors

404 Not Found

Cause: The vehicle does not exist, or it belongs to an organization outside the one in x-organization-id. Both cases return the same 404 on purpose — the API never reveals that a vehicle exists in another organization.

422 Unprocessable Entity

Cause: field is missing.
Cause: field is not one of the two accepted values.

Use Cases

Build a filter that never returns nothing

Call this endpoint before rendering the filter, and offer only the values it returns. A dropdown built from the catalog of all possible files would let a user pick one that has no consumptions for this vehicle; a dropdown built from this response cannot.

Find which upload produced which records

field=file_id groups a vehicle’s consumptions by the file they came from, with counts. That is the quickest way to confirm an import landed where you expected, and the input to a delete-by-file cleanup if it did not.

List Vehicle Consumptions

The records these values filter

Delete Consumptions by File

Remove every record that came from one file

Bulk Delete by Filters

Apply the filter you just built to a bulk delete

Filter Values (Organization)

The same values across every vehicle at once