Skip to main content
Use this endpoint to issue a new API key for your tenant. You define the exact set of permission scopes the key will carry, following the principle of least privilege — only grant the scopes a consumer actually needs. The raw key is included in the creation response exactly once and cannot be retrieved again. If the key is lost, you must revoke it and create a replacement.

Endpoint

Authorization

Requires an API key with ADMIN scope.
The raw API key is returned only once in the 201 response. Copy it to a secure secret store (such as a secrets manager or vault) immediately. There is no way to recover the raw value after this response.

Request Body

string[]
required
One or more permission scopes to assign to the new key. Must contain at least one entry; all values must be unique. See the table below for all valid scopes.

Available Scopes

Request Example

The following example creates a payment-processor key that can write transactions and read account information.

Response

string
required
Unique identifier (UUID) for the newly created API key.
string
required
The raw API key value, formatted sk_live_{uuid-no-dashes}. Shown only once. Store this value immediately.
string
required
The first 12 characters of rawKey. Used elsewhere (e.g. in audit logs and List API Keys) to identify the key without exposing its full value.
string[]
required
The permission scopes assigned to the key, as provided in the request.
string (datetime)
required
ISO 8601 timestamp of when the key was created.

Response Example

Scope keys narrowly. A service that only reads transactions does not need ADMIN or ACCOUNTS_WRITE. Narrow scopes limit the blast radius if a key is ever compromised.

Error Codes