Vehicles: basics
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.
List vehicles
GET /v1/vehicles
- Scope:
vehicles:readorvehicles:* - 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 |
|---|---|---|
subOrgId | string | |
assetClass | string | |
status | string | |
region | string | |
primaryDriverId | string | |
plate | string | |
cursor | string |
Request
No body.
Response
200: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
items | array of object | |
items[].id | string | |
items[].tenantId | string | |
items[].subOrgId | string | omitted when empty |
items[].vin | string | omitted when empty |
items[].registration | object | omitted when empty |
items[].registration.country | string | |
items[].registration.plate | string | |
items[].make | string | |
items[].model | string | |
items[].year | integer | |
items[].assetClass | string | |
items[].status | string | |
items[].capabilities | array of string | |
items[].currentRegion | string | omitted when empty |
items[].odometerKm | integer | |
items[].capacityTons | number | |
items[].fuelType | string | |
items[].primaryDriverId | string | omitted when empty |
items[].attachedDevices | array of string | |
items[].markerIcon | string | |
items[].markerIconSet | boolean | |
items[].speedLimitKph | integer | may be null |
items[].createdAt | string | |
items[].updatedAt | string | |
items[].version | integer | |
items[].etag | string | |
nextCursor | string |
Example
curl "https://api.zaitrack.app/v1/vehicles" \
-H "Authorization: Bearer zk_test_…"
Create a vehicle
POST /v1/vehicles
- Scope:
vehicles:writeorvehicles:* - Rate class:
write(50 per second and 36,000 per hour) - Idempotency-Key: optional
- Audited: no
- Step-up MFA: no
Request
Fields the handler reads, taken from its source.
| Field | Type | Notes |
|---|---|---|
subOrgId | string | optional |
vin | string | optional |
registration | object | optional |
registration.country | string | |
registration.plate | string | |
make | string | |
model | string | |
year | integer | |
assetClass | string | |
capabilities | array of string | optional |
currentRegion | string | optional |
odometerKm | integer | |
capacityTons | number | |
fuelType | string | |
markerIcon | string | optional |
speedLimitKph | integer | optional |
Response
201: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
id | string | |
tenantId | string | |
subOrgId | string | omitted when empty |
vin | string | omitted when empty |
registration | object | omitted when empty |
registration.country | string | |
registration.plate | string | |
make | string | |
model | string | |
year | integer | |
assetClass | string | |
status | string | |
capabilities | array of string | |
currentRegion | string | omitted when empty |
odometerKm | integer | |
capacityTons | number | |
fuelType | string | |
primaryDriverId | string | omitted when empty |
attachedDevices | array of string | |
markerIcon | string | |
markerIconSet | boolean | |
speedLimitKph | integer | may be null |
createdAt | string | |
updatedAt | string | |
version | integer | |
etag | string |
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X POST "https://api.zaitrack.app/v1/vehicles" \
-H "Authorization: Bearer zk_test_…" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"subOrgId": "…", "vin": "…", "registration": {"country": "…", "plate": "…"}, "make": "…", "model": "…", "year": 0, "assetClass": "…", "capabilities": [], "currentRegion": "…", "odometerKm": 0, "capacityTons": 0, "fuelType": "…", "markerIcon": "…", "speedLimitKph": 0}'
Get a vehicle
GET /v1/vehicles/{id}
- Scope:
vehicles:readorvehicles:* - Rate class:
read(100 per second and 360,000 per hour) - Idempotency-Key: not used
- Audited: no
- Step-up MFA: no
Path parameters: id.
Request
No body.
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Create a vehicle.
Example
curl "https://api.zaitrack.app/v1/vehicles/$ID" \
-H "Authorization: Bearer zk_test_…"
Update a vehicle (If-Match version)
PATCH /v1/vehicles/{id}
- Scope:
vehicles:writeorvehicles:* - 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: id.
Request
Fields the handler reads, taken from its source.
| Field | Type | Notes |
|---|---|---|
registration | object | optional |
registration.country | string | |
registration.plate | string | |
make | string | optional |
model | string | optional |
year | integer | optional |
capabilities | array of string | optional |
odometerKm | integer | optional |
capacityTons | number | optional |
fuelType | string | optional |
currentRegion | string | optional |
subOrgId | string | optional |
markerIcon | string | optional |
speedLimitKph | object | |
speedLimitKph.Set | boolean | |
speedLimitKph.Value | integer | optional |
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Create a vehicle.
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X PATCH "https://api.zaitrack.app/v1/vehicles/$ID" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Content-Type: application/json" \
-d '{"registration": {"country": "…", "plate": "…"}, "make": "…"}'
Decommission a vehicle
POST /v1/vehicles/{id}:decommission
- Scope:
vehicles:writeorvehicles:* - Rate class:
write(50 per second and 36,000 per hour) - Idempotency-Key: optional
- Audited: medium risk
- Step-up MFA: no
- If-Match: the version you read; a stale one is refused (412 or 409)
Path parameters: id.
Request
Fields the handler reads, taken from its source.
| Field | Type | Notes |
|---|---|---|
reason | string |
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Create a vehicle.
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X POST "https://api.zaitrack.app/v1/vehicles/$ID:decommission" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"reason": "…"}'
Reactivate a decommissioned vehicle
POST /v1/vehicles/{id}:reactivate
- Scope:
vehicles:writeorvehicles:* - Rate class:
write(50 per second and 36,000 per hour) - Idempotency-Key: optional
- Audited: low risk
- Step-up MFA: no
- If-Match: the version you read; a stale one is refused (412 or 409)
Path parameters: id.
Request
No body: the handler reads none.
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Create a vehicle.
Example
curl -X POST "https://api.zaitrack.app/v1/vehicles/$ID:reactivate" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)"