Maintenance: due, work orders
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.
Services due or overdue
GET /v1/maintenance/due
- 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 |
|---|---|---|
status | string | |
vehicleId | string |
Request
No body.
Response
200: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
items | array of object | |
items[].planId | — | |
items[].planName | — | |
items[].vehicleId | — | |
items[].status | — | |
items[].statusSince | string | |
items[].lastDoneAt | string | |
items[].lastDoneKm | — | |
items[].lastDoneHours | — | |
items[].nextDueAt | — | |
items[].nextDueKm | — | |
items[].nextDueHours | — | |
items[].openWorkOrderId | — |
Example
curl "https://api.zaitrack.app/v1/maintenance/due" \
-H "Authorization: Bearer zk_test_…"
List work orders
GET /v1/maintenance/work-orders
- 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 |
|---|---|---|
status | string | |
type | string | |
cursor | string | |
vehicleId | — | |
planId | — | |
pageSize | string |
Request
No body.
Response
200: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
items | array of object | |
items[].id | — | |
items[].number | — | |
items[].displayNumber | — | |
items[].vehicleId | — | |
items[].planId | — | |
items[].type | — | |
items[].priority | — | |
items[].status | — | |
items[].title | — | |
items[].description | — | |
items[].tasks | array of string | |
items[].assignee | — | |
items[].dueAt | — | |
items[].lines | array | |
items[].currency | — | |
items[].totalCents | — | |
items[].odometerKm | — | |
items[].engineHours | — | |
items[].notes | — | |
items[].cancelReason | — | |
items[].createdBy | — | |
items[].startedAt | — | |
items[].completedAt | — | |
items[].completedBy | — | |
items[].createdAt | string | |
items[].updatedAt | string | |
items[].version | — | |
nextCursor | string |
Example
curl "https://api.zaitrack.app/v1/maintenance/work-orders" \
-H "Authorization: Bearer zk_test_…"
Open a work order
POST /v1/maintenance/work-orders
- Scope:
maintenance:writeormaintenance:* - 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 |
|---|---|---|
vehicleId | string | |
planId | string | optional |
type | string | |
priority | string | |
title | string | |
description | string | |
tasks | array of string | |
assignee | string | |
dueAt | string | optional |
lines | array of object | |
lines[].kind | string | |
lines[].description | string | |
lines[].partId | string | optional |
lines[].quantity | number | |
lines[].unitCostCents | integer | |
lines[].totalCents | integer | |
currency | string |
Response
201: 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" \
-H "Authorization: Bearer zk_test_…" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"vehicleId": "…", "planId": "…", "type": "…", "priority": "…", "title": "…", "description": "…", "tasks": [], "assignee": "…", "dueAt": "…", "lines": [], "currency": "…"}'
Get a work order
GET /v1/maintenance/work-orders/{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.
The same fields as the response of Open a work order.
Example
curl "https://api.zaitrack.app/v1/maintenance/work-orders/$ID" \
-H "Authorization: Bearer zk_test_…"
Update a work order
PATCH /v1/maintenance/work-orders/{id}
- Scope:
maintenance:writeormaintenance:* - 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 |
|---|---|---|
vehicleId | string | optional |
title | string | optional |
description | string | optional |
assignee | string | optional |
notes | string | optional |
priority | string | optional |
dueAt | string | optional |
tasks | array of string | 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 | |
currency | string | optional |
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Open a work order.
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X PATCH "https://api.zaitrack.app/v1/maintenance/work-orders/$ID" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Content-Type: application/json" \
-d '{"vehicleId": "…", "title": "…"}'
Start a work order
POST /v1/maintenance/work-orders/{id}:start
- 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
No body: the handler reads none.
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Open a work order.
Example
curl -X POST "https://api.zaitrack.app/v1/maintenance/work-orders/$ID:start" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)"