Skip to main content
GET
List Consumption Filter Values (Organization)
← Vehicles API Get the distinct values a field takes across every vehicle in your organization, each with the number of records using it. This is the companion to the organization-wide consumption list: call it to build a filter that only offers values which actually exist.
Two versions of this endpoint, two scopes. This one is /v2 and covers the whole organization. Its /v1 sibling, List Consumption Filter Values, takes a vehicle_id in the path and covers one vehicle. Same query parameter, same response shape.

Request

Headers

string
required
UUID of the organization whose consumptions you are filtering.Format: UUID
string
Your API key.

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, with licence plates as labels
Any other value is rejected with 422, so this is a closed list.

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, and do not expect a null bucket — there isn’t one.

Example

Successful Response

Returns 200 OK.
The second entry is the nine records with no source file, not a file whose id happens to be zeros.

Common Errors

422 Unprocessable Entity

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

Use Cases

Filter the organization-wide consumption table

This is the endpoint behind the filter bar of List All Vehicle Consumptions. Because it returns counts, you can also show how many records sit behind each option before the user picks it.

Isolate one upload that was split across vehicles

A bulk upload usually creates consumptions on many vehicles at once. field=file_id gives you each source file with its record count in a single call — which is what you need before bulk-deleting an import that went wrong.

List All Consumptions (Organization)

The records these values filter

Bulk Delete by Filters (Organization)

Apply the filter you just built

Filter Values (one vehicle)

The same thing scoped to a single vehicle

Vehicles API

Everything the Vehicles API covers