Skip to the content
Menu: Keys

Keys

API keys and their scopes.

GET/v1/keys

List API keys

listKeysFull-access keyread: 600/min per key

The organisation's keys, newest first, revoked ones included. Never the secret.

Query parameters

  • limitinteger

    Page size, 1-200 (default 50).

  • cursorstring

    The nextCursor of the previous page.

Returns

200 A page of keys. A page: data is a list of ApiKey, and nextCursor fetches the next page.

Fields of data
  • idstringrequired

    API key id (key_…).

    pattern `^key_.*`

  • namestringrequired
  • prefixstringrequired

    The key's first characters, as shown in the console.

  • scopesstring[]required

    The scopes as set on the key; [] or ["*"] is full access (sensitive scopes are added by name).

  • apiVersion"2026-07-08" | "2026-10-01"required

    The contract the key speaks.

  • createdBystring | nullrequired

    Who made it: a member (usr_…) or a key (key_…); null for older keys.

  • lastUsedAtstring (date-time) | nullrequired
  • revokedAtstring (date-time) | nullrequired
  • createdAtstring (date-time)required

    ISO 8601 UTC timestamp.

Errors

invalid_requestunauthorizedforbiddenupgrade_requiredrate_limitedserver_error

Request

curl "https://app.zentiqai.com/v1/keys?limit=20" \
  -H "Authorization: Bearer $ZENTIQ_API_KEY"
Example answer
Response
{
  "data": [
    {
      "id": "key_cmfq2b7x10000abcd1234",
      "name": "Zoe",
      "prefix": "zq_live_ab12",
      "scopes": [
        "…"
      ],
      "apiVersion": "2026-07-08",
      "createdBy": "…"
    }
  ],
  "error": null,
  "requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d",
  "nextCursor": null
}
POST/v1/keys

Mint an API key

createKeyFull-access keywrite: 120/min per keyIdempotency-Key

Returns the secret once. Rotation: create a new key, move to it, then revoke the old one. A key can only give scopes it holds itself; the new key speaks this request's contract unless apiVersion says otherwise.

Body (optional)

  • namestring

    Up to 60 characters. Default "API key".

  • scopesstring[]

    Scope names, or ["*"] (the default, [] means the same) for full access. A key can only give scopes it holds itself.

    at most 64 items

  • apiVersion"2026-07-08" | "2026-10-01"

    The contract the new key speaks. Default: the contract of this request.

Returns

201 The new key, with its secret (shown once). data is KeyWithSecret.

Fields of data
  • idstringrequired

    API key id (key_…).

    pattern `^key_.*`

  • namestringrequired
  • prefixstringrequired

    The key's first characters, as shown in the console.

  • scopesstring[]required

    The scopes as set on the key; [] or ["*"] is full access (sensitive scopes are added by name).

  • apiVersion"2026-07-08" | "2026-10-01"required

    The contract the key speaks.

  • createdBystring | nullrequired

    Who made it: a member (usr_…) or a key (key_…); null for older keys.

  • lastUsedAtstring (date-time) | nullrequired
  • revokedAtstring (date-time) | nullrequired
  • createdAtstring (date-time)required

    ISO 8601 UTC timestamp.

  • keystringrequired

    The full key. Returned once: store it now.

Errors

invalid_requestunauthorizedforbiddenupgrade_requiredidempotency_conflictidempotency_in_progressrate_limitedserver_error

Request

curl -X POST "https://app.zentiqai.com/v1/keys" \
  -H "Authorization: Bearer $ZENTIQ_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Example answer
Response
{
  "data": {
    "id": "key_cmfq2b7x10000abcd1234",
    "name": "Zoe",
    "prefix": "zq_live_ab12",
    "scopes": [
      "…"
    ],
    "apiVersion": "2026-07-08",
    "createdBy": "…"
  },
  "error": null,
  "requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d"
}
DELETE/v1/keys/{id}

Revoke an API key (effective immediately)

revokeKeyFull-access keywrite: 120/min per key

The key stops working on its next request. A key can revoke itself.

Path parameters

  • idstringrequired

    API key id (key_…); the id without its prefix is accepted too.

Returns

200 Revoked. data is KeyRevoked.

Fields of data
  • revokedtruerequired
  • idstringrequired

    API key id (key_…).

    pattern `^key_.*`

Errors

invalid_requestunauthorizedforbiddenupgrade_requirednot_foundrate_limitedserver_error

Request

curl -X DELETE "https://app.zentiqai.com/v1/keys/key_123" \
  -H "Authorization: Bearer $ZENTIQ_API_KEY"
Example answer
Response
{
  "data": {
    "revoked": true,
    "id": "key_cmfq2b7x10000abcd1234"
  },
  "error": null,
  "requestId": "req_4f1c2e9a7b3d5e6f7a8b9c0d"
}