Skip to main content

API keys

3 operations at https://api.zaitrack.app. Request and response bodies are JSON with camelCase keys; ids are UUIDs; times are RFC 3339 in UTC.

Keys are made in Developer Studio or, live keys, in the console under Team → New API key; the API lists, rotates and revokes them.

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.

The organisation's API keys (no secrets)​

GET /v1/api-keys

The API has no call to create a key: keys are made in Developer Studio, which bounds a new key's scopes by yours. Secrets are never listed.

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

Request​

No body.

Response​

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

FieldTypeNotes
apiKeysarray of object
apiKeys[].idstring
apiKeys[].kindstring
apiKeys[].devTenantIdstring
apiKeys[].sandboxIdstringomitted when empty
apiKeys[].ownerUserIdstring
apiKeys[].labelstring
apiKeys[].prefixstring
apiKeys[].last4string
apiKeys[].modestring
apiKeys[].scopesarray of string
apiKeys[].ipAllowlistarray of string
apiKeys[].statusstring
apiKeys[].createdAtstring
apiKeys[].expiresAtstring
apiKeys[].rotationAfterAtstring
apiKeys[].secretstringomitted when empty

Example​

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

Rotate a key (the new secret is shown once)​

POST /v1/api-keys/{id}:rotate

Rotation keeps the key's scopes. The new secret is in the response once.

  • Scope: tenancy:write or tenancy:*
  • Rate class: credentials (10 per minute)
  • Idempotency-Key: optional
  • Audited: high risk
  • Step-up MFA: no

Path parameters: id.

Request​

No body: the handler reads none.

Response​

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

FieldTypeNotes
idstring
kindstring
devTenantIdstring
sandboxIdstringomitted when empty
ownerUserIdstring
labelstring
prefixstring
last4string
modestring
scopesarray of string
ipAllowlistarray of string
statusstring
createdAtstring
expiresAtstring
rotationAfterAtstring
secretstringomitted when empty

Example​

curl -X POST "https://api.zaitrack.app/v1/api-keys/$ID:rotate" \
-H "Authorization: Bearer zk_test_…" \
-H "Idempotency-Key: $(uuidgen)"

Revoke a key​

POST /v1/api-keys/{id}:revoke

  • Scope: tenancy:write or tenancy:*
  • Rate class: credentials (10 per minute)
  • Idempotency-Key: optional
  • Audited: high risk
  • Step-up MFA: no

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 Rotate a key (the new secret is shown once).

Example​

curl -X POST "https://api.zaitrack.app/v1/api-keys/$ID:revoke" \
-H "Authorization: Bearer zk_test_…" \
-H "Idempotency-Key: $(uuidgen)"