Skip to main content
POST
Rotate API key

Authorizations

Authorization
string
header
required

API Key authentication. Format: dk_test_ or dk_live_

Body

application/json

Request schema for creating a new API key (POST /v1/keys).

Attributes: name: Human-readable name for the API key (e.g., "Production API Key") environment: Key environment - "live" for production, "test" for testing (default: "live")

name
string
required

Human-readable name for this API key

Required string length: 1 - 255
environment
enum<string>
default:live

Key environment: 'live' for production, 'test' for testing

Available options:
live,
test

Response

New API key created and old key deprecated

Response for API key rotation (POST /v1/keys/rotate).

Returns the new key and information about the deprecated old key. The old key remains active for 7 days (grace period) to allow migration.

WARNING: The api_key field in new_key is shown only in this response. Store it securely immediately - it cannot be retrieved again.

new_key
CreateAPIKeyResponse · object
required

The newly created API key (includes plaintext key, shown only once)

Example:
deprecated_key
APIKeyResponse · object
required

The old key that was deprecated (with grace period information)

Examples: