Fuel: vehicles, tanks, tank events
6 operations at https://api.zaitrack.app. Request and response bodies are JSON with camelCase keys; ids are UUIDs; times are RFC 3339 in UTC.
Every operation needs an API key, a personal access token or an OAuth access token unless it says otherwise. An Idempotency-Key is replayed for 24 hours; see Idempotency. Errors are application/problem+json; see Errors.
Set a vehicle's fuel profile
PUT /v1/fuel/vehicles/{vehicleId}/profile
- Scope:
fuel:writeorfuel:* - Rate class:
write(50 per second and 36,000 per hour) - Idempotency-Key: not used
- Audited: no
- Step-up MFA: no
Path parameters: vehicleId.
Request
Fields the handler reads, taken from its source.
| Field | Type | Notes |
|---|---|---|
product | string | |
tankLitres | number | |
expectedL100km | number |
Response
200: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
vehicleId | — | |
product | string | |
tankLitres | number | |
expectedL100km | number | |
updatedAt | string |
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X PUT "https://api.zaitrack.app/v1/fuel/vehicles/$VEHICLE_ID/profile" \
-H "Authorization: Bearer zk_test_…" \
-H "Content-Type: application/json" \
-d '{"product": "…", "tankLitres": 0, "expectedL100km": 0}'
Tank levels across the fleet
GET /v1/fuel/tanks
- Scope:
fuel:readorfuel:* - Rate class:
read(100 per second and 360,000 per hour) - Idempotency-Key: not used
- Audited: no
- Step-up MFA: no
Request
No body.
Response
200: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
items | array of object | |
items[].vehicleId | — | |
items[].source | — | |
items[].capacityL | — | |
items[].calibration | — | |
items[].refuelMinL | — | |
items[].drainMinL | — | |
items[].updatedAt | string | |
items[].version | — | |
items[].last | — | |
items[].levelPct | — |
Example
curl "https://api.zaitrack.app/v1/fuel/tanks" \
-H "Authorization: Bearer zk_test_…"
A vehicle's tank
GET /v1/fuel/vehicles/{vehicleId}/tank
- Scope:
fuel:readorfuel:* - Rate class:
read(100 per second and 360,000 per hour) - Idempotency-Key: not used
- Audited: no
- Step-up MFA: no
Path parameters: vehicleId.
Request
No body.
Response
200: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
vehicleId | — | |
source | — | |
capacityL | — | |
calibration | — | |
refuelMinL | — | |
drainMinL | — | |
updatedAt | string | |
version | — | |
last | — | |
levelPct | — |
Example
curl "https://api.zaitrack.app/v1/fuel/vehicles/$VEHICLE_ID/tank" \
-H "Authorization: Bearer zk_test_…"
Set a vehicle's tank
PUT /v1/fuel/vehicles/{vehicleId}/tank
- Scope:
fuel:writeorfuel:* - Rate class:
write(50 per second and 36,000 per hour) - Idempotency-Key: not used
- Audited: no
- Step-up MFA: no
- If-Match: the version you read; a stale one is refused (412 or 409)
Path parameters: vehicleId.
Request
Fields the handler reads, taken from its source.
| Field | Type | Notes |
|---|---|---|
source | string | |
capacityL | number | |
calibration | array of object | |
calibration[].raw | number | |
calibration[].litres | number | |
refuelMinL | number | |
drainMinL | number |
Response
200: fields the handler writes, taken from its source.
The same fields as the response of A vehicle's tank.
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X PUT "https://api.zaitrack.app/v1/fuel/vehicles/$VEHICLE_ID/tank" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Content-Type: application/json" \
-d '{"source": "…", "capacityL": 0, "calibration": [], "refuelMinL": 0, "drainMinL": 0}'
A vehicle's fuel level over time
GET /v1/fuel/vehicles/{vehicleId}/levels
- Scope:
fuel:readorfuel:* - Rate class:
telemetry(10 per second and 180,000 per hour) - Idempotency-Key: not used
- Audited: no
- Step-up MFA: no
Path parameters: vehicleId.
| Query parameter | Type | Notes |
|---|---|---|
points | string | |
from | string | |
to | string |
Request
No body.
Response
200: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
items | array of object | |
items[].at | string | |
items[].litres | — | |
items[].moving | — | |
items[].lat | — | |
items[].lon | — |
Example
curl "https://api.zaitrack.app/v1/fuel/vehicles/$VEHICLE_ID/levels" \
-H "Authorization: Bearer zk_test_…"
Refuels and drains
GET /v1/fuel/tank-events
- Scope:
fuel:readorfuel:* - Rate class:
read(100 per second and 360,000 per hour) - Idempotency-Key: not used
- Audited: no
- Step-up MFA: no
| Query parameter | Type | Notes |
|---|---|---|
kind | string | |
vehicleId | string | |
limit | string | |
from | string | |
to | string |
Request
No body.
Response
200: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
items | array of object | |
items[].id | — | |
items[].vehicleId | — | |
items[].kind | — | |
items[].from | string | |
items[].to | string | |
items[].litres | — | |
items[].beforeL | — | |
items[].afterL | — | |
items[].lat | — | |
items[].lon | — | |
items[].transactionId | — | |
items[].createdAt | string |
Example
curl "https://api.zaitrack.app/v1/fuel/tank-events" \
-H "Authorization: Bearer zk_test_…"