Drivers: basics
5 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.
Suspend a driver
POST /v1/drivers/{id}:suspend
- Scope:
drivers:writeordrivers:* - 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.
| Field | Type | Notes |
|---|---|---|
id | string | |
tenantId | string | |
subOrgId | string | omitted when empty |
employeeNumber | string | |
firstName | string | |
lastName | string | |
dateOfBirth | string | |
nationalIdMasked | string | omitted when empty |
email | string | omitted when empty |
phone | string | omitted when empty |
status | string | |
hireDate | string | |
terminationDate | string | omitted when empty |
license | object | |
license.number | string | |
license.country | string | |
license.classes | array of string | |
license.issuedAt | string | omitted when empty |
license.expiresAt | string | |
license.endorsements | array of string | omitted when empty |
license.LocalClass | — | |
license.authority | string | omitted when empty |
license.localClass | string | omitted when empty |
licenseValid | boolean | |
qualifications | array of object | |
qualifications[].code | string | |
qualifications[].issuedAt | string | |
qualifications[].expiresAt | string | omitted when empty |
qualifications[].issuingBody | string | omitted when empty |
homeRegion | string | omitted when empty |
languages | array of string | |
assignable | boolean | |
nationality | string | omitted when empty |
employment | string | |
contractorCompany | string | omitted when empty |
photo | object | may be null |
photo.contentType | string | |
photo.size | integer | |
photo.updatedAt | string | |
photo.updatedBy | string | omitted when empty |
createdAt | string | |
updatedAt | string | |
version | integer |
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X POST "https://api.zaitrack.app/v1/drivers/$ID:suspend" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"reason": "…"}'
Put a driver on leave
POST /v1/drivers/{id}:leave
- Scope:
drivers:writeordrivers:* - 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 Suspend a driver.
Example
curl -X POST "https://api.zaitrack.app/v1/drivers/$ID:leave" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)"
Terminate a driver
POST /v1/drivers/{id}:terminate
- Scope:
drivers:writeordrivers:* - 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 |
|---|---|---|
date | string |
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Suspend a driver.
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X POST "https://api.zaitrack.app/v1/drivers/$ID:terminate" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"date": "…"}'
Record a renewed licence
POST /v1/drivers/{id}:renew-license
- Scope:
drivers:writeordrivers:* - 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. The service's OpenAPI document describes a different body; this page follows the handler.
| Field | Type | Notes |
|---|---|---|
number | string | |
country | string | |
classes | array of string | |
issuedAt | string | optional |
expiresAt | string | |
endorsements | array of string | optional |
LocalClass | — | |
authority | string | optional |
localClass | string | optional |
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Suspend a driver.
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X POST "https://api.zaitrack.app/v1/drivers/$ID:renew-license" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"number": "…", "country": "…", "classes": [], "issuedAt": "…", "expiresAt": "…", "endorsements": [], "LocalClass": null, "authority": "…", "localClass": "…"}'
Add a qualification
POST /v1/drivers/{id}:add-qualification
- Scope:
drivers:writeordrivers:* - 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 |
|---|---|---|
code | string | |
issuedAt | string | |
expiresAt | string | optional |
issuingBody | string | optional |
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Suspend a driver.
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X POST "https://api.zaitrack.app/v1/drivers/$ID:add-qualification" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"code": "…", "issuedAt": "…", "expiresAt": "…", "issuingBody": "…"}'