Skip to main content
POST
/
v1
/
keys
Create API key
curl --request POST \
  --url http://localhost:8000/v1/keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "environment": "live"
}
'
{
  "key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "api_key": "<string>",
  "environment": "<string>",
  "created_at": "2023-11-07T05:31:56Z"
}

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

API key created successfully

Response for newly created API key (shown only once).

WARNING: The api_key field is shown only in this response. Once this response is received, the plaintext key cannot be retrieved again. Store it securely immediately.

key_id
string<uuid>
required

Unique API key identifier

name
string
required

Human-readable name for this API key

api_key
string
required

The actual API key (shown ONLY in this response - cannot be retrieved later)

environment
string
required

Key environment (live or test)

created_at
string<date-time>
required

Key creation timestamp (ISO 8601)