v1

latestOpenAPI 3.0.22026-07-26128245430.3 KB
API Keys

Create a scoped API key

Create a new API key restricted to a subset of scopes. The returned value is the only opportunity to retrieve the plaintext secret — store it securely. This endpoint does not accept an Idempotency-Key header; each call creates a new key.

Callers may only grant scopes they themselves hold (scope subsetting). Unrestricted keys may create scoped keys; scoped keys need the api_key:create scope. Up to 500 scoped keys may exist per developer.

post/api_keys

Request body

scopesApiKeyScope[] required

Scopes to grant the new key. Must be a non-empty array. Each scope must be one you yourself hold (scope subsetting).

namestring

A human-readable label for this key, up to 100 characters. Useful for identifying the key's purpose later.

Response

The API key was created. value is returned exactly once.

idstring uuid required

The unique identifier for this API key.

type'Public' | 'Private' required

Whether the key was created programmatically (Private) or via the Dashboard (Public).

owner_type'Developer' required

The type of entity that owns the key. Always Developer.

owner_idstring uuid required

The developer ID that owns the key.

prefix'sk-live' | 'sk-test' required

The environment prefix of the key. sk-live in production, sk-test in sandbox.

last_4string required

The last four characters of the key, shown alongside the prefix for disambiguation in audit logs.

state'Active' | 'Deleted' required

Lifecycle state of the key.

created_atstring date-time required
updated_atstring date-time required
scopesstring[] required

The scopes authorized on this key. A single-element list containing bridge:api_unrestricted denotes an unrestricted key (all standard scopes). Any other list denotes a scoped key.

namestring

The human-readable label for this key, if one was provided at creation.

valuestring required

The plaintext secret for this API key. Store it securely — it cannot be retrieved again.

Example response

{
  "value": "sk-live-0123456789abcdef0123456789ab9f2c"
}
All 128 operations