v1

latestOpenAPI 3.0.32026-07-2246176.0 KB

Create API key

Create a new API key with a name, permissions, and optional scopes (allowed_subaccounts, allowed_ips, expires_at). The full 64-character token is returned only once in this response — store it securely. Permission: account:apikeys:create.

post/v4/account/api-keys

Request body

namestring required

Human-readable label for the key.

permissionsstring[] required

List of permission strings. Use GET /v4/account/api-keys/allowed-permissions to see what your account can grant.

allowed_subaccountsstring[]

Subaccount UUIDs this key can act on. Empty array means all subaccounts.

allowed_ipsstring[]

IP addresses or CIDR ranges allowed to use this key. Empty array means no IP restriction.

expires_atinteger nullable

Unix timestamp for key expiry. Must be in the future. Omit or null for no expiry.

Response

Created API key. The data.token field contains the 64-character secret — store it securely, it is only shown once.

successboolean
messagestring
warningstring

Example response

{
  "message": "API key created successfully",
  "warning": "This token will only be shown once. Please copy it now."
}