Skip to main content

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:write or maintenance:*
  • 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.

FieldTypeNotes
odometerKmnumberoptional
engineHoursnumberoptional
linesarray of objectoptional
lines[].kindstring
lines[].descriptionstring
lines[].partIdstringoptional
lines[].quantitynumber
lines[].unitCostCentsinteger
lines[].totalCentsinteger
notesstringoptional
completedAtstringoptional

Response​

200: fields the handler writes, taken from its source.

FieldTypeNotes
id—
number—
displayNumber—
vehicleId—
planId—
type—
priority—
status—
title—
description—
tasksarray of string
assignee—
dueAt—
linesarray of object
lines[].kindstring
lines[].descriptionstring
lines[].partIdstringomitted when empty
lines[].quantitynumber
lines[].unitCostCentsinteger
lines[].totalCentsinteger
currency—
totalCents—
odometerKm—
engineHours—
notes—
cancelReason—
createdBy—
startedAt—
completedAt—
completedBy—
createdAtstring
updatedAtstring
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:write or maintenance:*
  • 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.

FieldTypeNotes
reasonstring

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:read or maintenance:*
  • Rate class: read (100 per second and 360,000 per hour)
  • Idempotency-Key: not used
  • Audited: no
  • Step-up MFA: no
Query parameterTypeNotes
cursorstring
pageSizestring
statusstring

Request​

No body.

Response​

200: from the service's OpenAPI document.

FieldTypeNotes
itemsarray of object
items[].clearNoteany JSON
items[].clearedAtany JSON
items[].clearedByany JSON
items[].createdAtstring
items[].defectCountinteger
items[].driverIdstring
items[].idstring
items[].itemsarray of object
items[].items[].itemstring
items[].items[].notestring
items[].items[].resultstring
items[].items[].severitystring
items[].kindstring
items[].odometerKmnumber or null
items[].performedAtstring
items[].remarksstring
items[].safeToOperateboolean
items[].signedBystring
items[].statusstring
items[].vehicleIdstring
items[].versioninteger
items[].workOrderIdany JSON
items[].worstSeverityany JSON
nextCursorstring

Example​

curl "https://api.zaitrack.app/v1/maintenance/inspections" \
-H "Authorization: Bearer zk_test_…"

Get an inspection​

GET /v1/maintenance/inspections/{id}

  • Scope: maintenance:read or maintenance:*
  • 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.

FieldTypeNotes
id—
vehicleId—
driverId—
kind—
performedAtstring
odometerKm—
itemsarray of object
items[].item—
items[].result—
defectCount—
worstSeverity—
safeToOperate—
remarks—
signedBy—
status—
workOrderId—
clearedAt—
clearedBy—
clearNote—
createdAtstring
version—

Example​

curl "https://api.zaitrack.app/v1/maintenance/inspections/$ID" \
-H "Authorization: Bearer zk_test_…"