Skip to main content

Seal commands

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.

Open an electronic seal with an audit reason​

POST /v1/seal-commands

  • Scope: commands:write or commands:*
  • Rate class: command (20 per second and 360,000 per hour)
  • Idempotency-Key: required
  • Audited: high risk
  • Step-up MFA: required (an OAuth session with a recent WebAuthn step-up; API keys never qualify)

Request​

Fields the handler reads, taken from its source.

FieldTypeNotes
deviceIdstring (UUID)
vehicleIdstring (UUID)optional
kindstring
payloadany JSON
reasonstringoptional
ttlSintegeroptional
maxAttemptsintegeroptional
idempotencyKeystring
channelstringoptional

Response​

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

FieldTypeNotes
idstring (UUID)
tenantIdstring (UUID)
deviceIdstring (UUID)
vehicleIdstring (UUID)omitted when empty
kindstring
payloadany JSON
riskstring
reasonstringomitted when empty
issuerobject
issuer.idstring
issuer.rolestringomitted when empty
issuedAtstring (date-time)
ttlinteger (ns)
idempotencyKeystring
bodySha256string
approvalsarray of object
approvals[].byobject
approvals[].by.idstring
approvals[].by.rolestringomitted when empty
approvals[].approvedboolean
approvals[].atstring (date-time)
approvals[].notestringomitted when empty
approvedAtstring (date-time)omitted when empty
statestring
nextAtstring (date-time)
attemptsinteger
maxAttemptsinteger
holdstringomitted when empty
ackobjectomitted when empty
ack.statestring
ack.detailsany JSON
ack.atstring (date-time)
failurestringomitted when empty
versioninteger
approvalsRequiredintegeromitted when empty
channelstringomitted when empty
smsTostringomitted when empty
smsRefstringomitted when empty

Example​

Every field is sent with a placeholder value: replace them with yours.

Set STEP_UP_ACCESS_TOKEN to an OAuth session access token with a recent WebAuthn step-up. An API key or personal access token does not satisfy this requirement.

curl -X POST "https://api.zaitrack.app/v1/seal-commands" \
-H "Authorization: Bearer $STEP_UP_ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"deviceId": "00000000-0000-0000-0000-000000000000", "vehicleId": "00000000-0000-0000-0000-000000000000", "kind": "…", "payload": null, "reason": "…", "ttlS": 0, "maxAttempts": 0, "idempotencyKey": "…", "channel": "…"}'

List electronic seal commands​

GET /v1/seal-commands

  • Scope: commands:read or commands:*
  • Rate class: read (100 per second and 360,000 per hour)
  • Idempotency-Key: not used
  • Audited: no
  • Step-up MFA: no
Query parameterTypeNotes
deviceIdstring
vehicleIdstring
limitstring
statestring

Request​

No body.

Response​

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

Keys: items. Their types are not described.

Example​

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

A seal command with its events​

GET /v1/seal-commands/{id}

  • Scope: commands:read or commands:*
  • 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: not described. The service's OpenAPI document has no schema for this response, and the handler's could not be read from its source.

Example​

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

Approve a pending seal command​

POST /v1/seal-commands/{id}:approve

  • Scope: commands:approve or commands:*
  • Rate class: command (20 per second and 360,000 per hour)
  • Idempotency-Key: optional
  • Audited: high risk
  • Step-up MFA: required (an OAuth session with a recent WebAuthn step-up; API keys never qualify)

Path parameters: id.

Request​

Fields the handler reads, taken from its source. One handler serves several actions here, so a field may not apply to this one.

FieldTypeNotes
notestring

Response​

200: not described. The service's OpenAPI document has no schema for this response, and the handler's could not be read from its source.

Example​

Every field is sent with a placeholder value: replace them with yours.

Set STEP_UP_ACCESS_TOKEN to an OAuth session access token with a recent WebAuthn step-up. An API key or personal access token does not satisfy this requirement.

curl -X POST "https://api.zaitrack.app/v1/seal-commands/$ID:approve" \
-H "Authorization: Bearer $STEP_UP_ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"note": "…"}'

Deny a pending seal command​

POST /v1/seal-commands/{id}:deny

  • Scope: commands:approve or commands:*
  • Rate class: command (20 per second and 360,000 per hour)
  • Idempotency-Key: optional
  • Audited: medium risk
  • Step-up MFA: no

Path parameters: id.

Request​

Fields the handler reads, taken from its source. One handler serves several actions here, so a field may not apply to this one.

The same fields as the request of Approve a pending seal command.

Response​

200: not described. The service's OpenAPI document has no schema for this response, and the handler's could not be read from its source.

Example​

Every field is sent with a placeholder value: replace them with yours.

curl -X POST "https://api.zaitrack.app/v1/seal-commands/$ID:deny" \
-H "Authorization: Bearer zk_test_…" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"note": "…"}'

Cancel a seal command not yet sent​

POST /v1/seal-commands/{id}:cancel

  • Scope: commands:write or commands:*
  • Rate class: command (20 per second and 360,000 per hour)
  • Idempotency-Key: optional
  • Audited: low risk
  • Step-up MFA: no

Path parameters: id.

Request​

Fields the handler reads, taken from its source. One handler serves several actions here, so a field may not apply to this one.

The same fields as the request of Approve a pending seal command.

Response​

200: not described. The service's OpenAPI document has no schema for this response, and the handler's could not be read from its source.

Example​

Every field is sent with a placeholder value: replace them with yours.

curl -X POST "https://api.zaitrack.app/v1/seal-commands/$ID:cancel" \
-H "Authorization: Bearer zk_test_…" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"note": "…"}'