إنتقل إلى المحتوى الرئيسي

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

FieldTypeNotes
idstring
tenantIdstring
subOrgIdstringomitted when empty
employeeNumberstring
firstNamestring
lastNamestring
dateOfBirthstring
nationalIdMaskedstringomitted when empty
emailstringomitted when empty
phonestringomitted when empty
statusstring
hireDatestring
terminationDatestringomitted when empty
licenseobject
license.numberstring
license.countrystring
license.classesarray of string
license.issuedAtstringomitted when empty
license.expiresAtstring
license.endorsementsarray of stringomitted when empty
license.LocalClass—
license.authoritystringomitted when empty
license.localClassstringomitted when empty
licenseValidboolean
qualificationsarray of object
qualifications[].codestring
qualifications[].issuedAtstring
qualifications[].expiresAtstringomitted when empty
qualifications[].issuingBodystringomitted when empty
homeRegionstringomitted when empty
languagesarray of string
assignableboolean
nationalitystringomitted when empty
employmentstring
contractorCompanystringomitted when empty
photoobjectmay be null
photo.contentTypestring
photo.sizeinteger
photo.updatedAtstring
photo.updatedBystringomitted when empty
createdAtstring
updatedAtstring
versioninteger

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

FieldTypeNotes
datestring

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

FieldTypeNotes
numberstring
countrystring
classesarray of string
issuedAtstringoptional
expiresAtstring
endorsementsarray of stringoptional
LocalClass—
authoritystringoptional
localClassstringoptional

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:write or drivers:*
  • 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
codestring
issuedAtstring
expiresAtstringoptional
issuingBodystringoptional

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": "…"}'