Contents

API reference

API keys

API reference descriptions are provided in English to preserve the exact published contract.

List API key metadata

GET /v1/accounts/{AC}/api-keys

List API keys: name, scopes, restrictions and last use. Secrets are never shown. Required scope: `api_keys:read`.

Parameters

Parameters
NameTypeRequiredDescription
limitquery · integer (1–100)
cursorquery · string (max 2048 chars)
ACpath · string (AC… SID)yesAccount SID

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.

Create an API key and reveal its secret once

POST /v1/accounts/{AC}/api-keys

Create an API key. The secret is in this response only; store it now. Give each key the fewest scopes it needs. Required scope: `api_keys:write`.

Parameters

Parameters
NameTypeRequiredDescription
ACpath · string (AC… SID)yesAccount SID
Request body (7 fields)
Request body
NameTypeRequiredDescription
allowedCidrsstring (max 64 chars)[]
displayNamestring (max 128 chars)yes
expiresAtstring (date-time)
requireSigningboolean
scopesstring (pattern ^(?:[*]|[a-z][a-z0-9_-]*:[a-z*][a-z0-9_*-]*)$)[]yes
stepUpTokenstring (max 256 chars)yes
subaccountSidstring (SA… SID)

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.

List the scopes an API key can be given

GET /v1/accounts/{AC}/api-keys/scopes

The scope catalogue, grouped, with plain-language labels (M-38). `held` marks the scopes the caller may put on a new key: a key never exceeds the user or key creating it. Required scope: `api_keys:read`.

Parameters

Parameters
NameTypeRequiredDescription
ACpath · string (AC… SID)yesAccount SID

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.

Get API key metadata

GET /v1/accounts/{AC}/api-keys/{SK}

Required scope: `api_keys:read`.

Parameters

Parameters
NameTypeRequiredDescription
ACpath · string (AC… SID)yesAccount SID
SKpath · string (SK… SID)yes

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.

Update API key restrictions

PATCH /v1/accounts/{AC}/api-keys/{SK}

Required scope: `api_keys:write`.

Parameters

Parameters
NameTypeRequiredDescription
ACpath · string (AC… SID)yesAccount SID
SKpath · string (SK… SID)yes
Request body (5 fields)
Request body
NameTypeRequiredDescription
allowedCidrsstring (max 64 chars)[]
displayNamestring (max 128 chars)
expiresAtstring (date-time) | null
requireSigningboolean
stepUpTokenstring (max 256 chars)

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.

Disable an API key

POST /v1/accounts/{AC}/api-keys/{SK}/disable

Required scope: `api_keys:write`.

Parameters

Parameters
NameTypeRequiredDescription
ACpath · string (AC… SID)yesAccount SID
SKpath · string (SK… SID)yes
Request body (2 fields)
Request body
NameTypeRequiredDescription
reasonstring (max 1000 chars)yes
stepUpTokenstring (max 256 chars)yes

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.

Stop the replaced secret of a rotated API key working now

POST /v1/accounts/{AC}/api-keys/{SK}/end-overlap

After a rotation the previous secret keeps working until previousSecretExpiresAt. Call this once every client uses the new secret. It only narrows access, so it needs no step-up. Required scope: `api_keys:write`.

Parameters

Parameters
NameTypeRequiredDescription
ACpath · string (AC… SID)yesAccount SID
SKpath · string (SK… SID)yes
Request body (1 fields)
Request body
NameTypeRequiredDescription
reasonstring (max 1000 chars)yes

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.

Revoke an API key

POST /v1/accounts/{AC}/api-keys/{SK}/revoke

Revoke a key immediately and for good. A revoked key is never re-enabled. Required scope: `api_keys:write`.

Parameters

Parameters
NameTypeRequiredDescription
ACpath · string (AC… SID)yesAccount SID
SKpath · string (SK… SID)yes
Request body (2 fields)
Request body
NameTypeRequiredDescription
reasonstring (max 1000 chars)yes
stepUpTokenstring (max 256 chars)yes

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.

Rotate an API key and reveal the replacement secret once

POST /v1/accounts/{AC}/api-keys/{SK}/rotate

Replace a key's secret. The response shows the new secret once; store it now. Required scope: `api_keys:write`.

Parameters

Parameters
NameTypeRequiredDescription
ACpath · string (AC… SID)yesAccount SID
SKpath · string (SK… SID)yes
Request body (3 fields)
Request body
NameTypeRequiredDescription
overlapHoursinteger (0–168)Hours the current secret stays valid beside the new one. Default 24; 0 ends it immediately; at most 168 (7 days).
reasonstring (max 1000 chars)yes
stepUpTokenstring (max 256 chars)yes

Errors: 400, 401, 403, 404, 409, 422, 429, 500, 503 — see errors.