Skip to main content

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: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
statusstring
vehicleIdstring

Request​

No body.

Response​

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

FieldTypeNotes
itemsarray of object
items[].planId—
items[].planName—
items[].vehicleId—
items[].status—
items[].statusSincestring
items[].lastDoneAtstring
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: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
statusstring
typestring
cursorstring
vehicleId—
planId—
pageSizestring

Request​

No body.

Response​

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

FieldTypeNotes
itemsarray of object
items[].id—
items[].number—
items[].displayNumber—
items[].vehicleId—
items[].planId—
items[].type—
items[].priority—
items[].status—
items[].title—
items[].description—
items[].tasksarray of string
items[].assignee—
items[].dueAt—
items[].linesarray
items[].currency—
items[].totalCents—
items[].odometerKm—
items[].engineHours—
items[].notes—
items[].cancelReason—
items[].createdBy—
items[].startedAt—
items[].completedAt—
items[].completedBy—
items[].createdAtstring
items[].updatedAtstring
items[].version—
nextCursorstring

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

FieldTypeNotes
vehicleIdstring
planIdstringoptional
typestring
prioritystring
titlestring
descriptionstring
tasksarray of string
assigneestring
dueAtstringoptional
linesarray of object
lines[].kindstring
lines[].descriptionstring
lines[].partIdstringoptional
lines[].quantitynumber
lines[].unitCostCentsinteger
lines[].totalCentsinteger
currencystring

Response​

201: 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" \
-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: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.

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

FieldTypeNotes
vehicleIdstringoptional
titlestringoptional
descriptionstringoptional
assigneestringoptional
notesstringoptional
prioritystringoptional
dueAtstringoptional
tasksarray of stringoptional
linesarray of objectoptional
lines[].kindstring
lines[].descriptionstring
lines[].partIdstringoptional
lines[].quantitynumber
lines[].unitCostCentsinteger
lines[].totalCentsinteger
currencystringoptional

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: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​

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)"