Skip to main content

Personal access tokens

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.

A personal access token acts as the person who made it, and every use is audited.

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.

Your personal access tokens​

GET /v1/api-tokens

  • Scope: any signed-in caller; the service decides
  • Rate class: credentials (10 per minute)
  • Idempotency-Key: not used
  • Audited: no
  • Step-up MFA: no

Request​

No body.

Response​

200: from the service's OpenAPI document.

FieldTypeNotes
tokensarray of object
tokens[].createdAtstringrequired
tokens[].devTenantIdstringrequired
tokens[].expiresAtstringrequired
tokens[].idstringrequired
tokens[].ipAllowlistarray of stringrequired
tokens[].kindstringrequired
tokens[].labelstringrequired
tokens[].last4stringrequired
tokens[].modestringrequired
tokens[].ownerUserIdstringrequired
tokens[].prefixstringrequired
tokens[].rotationAfterAtstringrequired
tokens[].sandboxIdstring
tokens[].scopesarray of stringrequired
tokens[].secretstring
tokens[].statusstringrequired

Example​

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

Mint a personal access token (shown once)​

POST /v1/api-tokens

Call it with an OAuth access token from your own signed-in session: tenancy-service refuses API keys and other non-interactive credentials, and a token's scopes are never wider than yours. The token (zpat_…) is in the response once.

  • Scope: any signed-in caller; the service decides
  • Rate class: credentials (10 per minute)
  • Idempotency-Key: not used
  • Audited: no
  • Step-up MFA: no

Request​

From the service's OpenAPI document.

FieldTypeNotes
ipAllowlistarray of stringrequired
labelstringrequired
scopesarray of stringrequired
ttlDaysintegerrequired

Response​

201: from the service's OpenAPI document.

FieldTypeNotes
createdAtstringrequired
devTenantIdstringrequired
expiresAtstringrequired
idstringrequired
ipAllowlistarray of stringrequired
kindstringrequired
labelstringrequired
last4stringrequired
modestringrequired
ownerUserIdstringrequired
prefixstringrequired
rotationAfterAtstringrequired
sandboxIdstring
scopesarray of stringrequired
secretstring
statusstringrequired

Example​

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

curl -X POST "https://api.zaitrack.app/v1/api-tokens" \
-H "Authorization: Bearer zk_test_…" \
-H "Content-Type: application/json" \
-d '{"ipAllowlist": [], "label": "…", "scopes": [], "ttlDays": 0}'

Revoke a personal access token​

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

  • Scope: any signed-in caller; the service decides
  • Rate class: credentials (10 per minute)
  • Idempotency-Key: not used
  • Audited: no
  • Step-up MFA: no

Path parameters: id.

Request​

No body: the OpenAPI document declares none.

Response​

200: from the service's OpenAPI document.

The same fields as the response of Mint a personal access token (shown once).

Example​

curl -X POST "https://api.zaitrack.app/v1/api-tokens/$ID:revoke" \
-H "Authorization: Bearer zk_test_…"