Maintenance: work orders, inspections
4 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.
Complete a work order
POST /v1/maintenance/work-orders/{id}:complete
- Scope:
maintenance:writeormaintenance:* - Rate class:
write(50 per second and 36,000 per hour) - Idempotency-Key: optional
- 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 |
|---|---|---|
odometerKm | number | optional |
engineHours | number | optional |
lines | array of object | optional |
lines[].kind | string | |
lines[].description | string | |
lines[].partId | string | optional |
lines[].quantity | number | |
lines[].unitCostCents | integer | |
lines[].totalCents | integer | |
notes | string | optional |
completedAt | string | optional |
Response
200: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
id | — | |
number | — | |
displayNumber | — | |
vehicleId | — | |
planId | — | |
type | — | |
priority | — | |
status | — | |
title | — | |
description | — | |
tasks | array of string | |
assignee | — | |
dueAt | — | |
lines | array of object | |
lines[].kind | string | |
lines[].description | string | |
lines[].partId | string | omitted when empty |
lines[].quantity | number | |
lines[].unitCostCents | integer | |
lines[].totalCents | integer | |
currency | — | |
totalCents | — | |
odometerKm | — | |
engineHours | — | |
notes | — | |
cancelReason | — | |
createdBy | — | |
startedAt | — | |
completedAt | — | |
completedBy | — | |
createdAt | string | |
updatedAt | string | |
version | — |
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X POST "https://api.zaitrack.app/v1/maintenance/work-orders/$ID:complete" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"odometerKm": 0, "engineHours": 0, "lines": [], "notes": "…", "completedAt": "…"}'
Cancel a work order
POST /v1/maintenance/work-orders/{id}:cancel
- Scope:
maintenance:writeormaintenance:* - 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
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 Complete a work order.
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X POST "https://api.zaitrack.app/v1/maintenance/work-orders/$ID:cancel" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"reason": "…"}'
List vehicle inspections
GET /v1/maintenance/inspections
- Scope:
maintenance:readormaintenance:* - 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 |
|---|---|---|
cursor | string | |
pageSize | string | |
status | string |
Request
No body.
Response
200: from the service's OpenAPI document.
| Field | Type | Notes |
|---|---|---|
items | array of object | |
items[].clearNote | any JSON | |
items[].clearedAt | any JSON | |
items[].clearedBy | any JSON | |
items[].createdAt | string | |
items[].defectCount | integer | |
items[].driverId | string | |
items[].id | string | |
items[].items | array of object | |
items[].items[].item | string | |
items[].items[].note | string | |
items[].items[].result | string | |
items[].items[].severity | string | |
items[].kind | string | |
items[].odometerKm | number or null | |
items[].performedAt | string | |
items[].remarks | string | |
items[].safeToOperate | boolean | |
items[].signedBy | string | |
items[].status | string | |
items[].vehicleId | string | |
items[].version | integer | |
items[].workOrderId | any JSON | |
items[].worstSeverity | any JSON | |
nextCursor | string |
Example
curl "https://api.zaitrack.app/v1/maintenance/inspections" \
-H "Authorization: Bearer zk_test_…"
Get an inspection
GET /v1/maintenance/inspections/{id}
- Scope:
maintenance:readormaintenance:* - 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.
| Field | Type | Notes |
|---|---|---|
id | — | |
vehicleId | — | |
driverId | — | |
kind | — | |
performedAt | string | |
odometerKm | — | |
items | array of object | |
items[].item | — | |
items[].result | — | |
defectCount | — | |
worstSeverity | — | |
safeToOperate | — | |
remarks | — | |
signedBy | — | |
status | — | |
workOrderId | — | |
clearedAt | — | |
clearedBy | — | |
clearNote | — | |
createdAt | string | |
version | — |
Example
curl "https://api.zaitrack.app/v1/maintenance/inspections/$ID" \
-H "Authorization: Bearer zk_test_…"