Skip to main content
POST
Create an API key

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

API key name (1-255 characters)

Required string length: 1 - 255
Example:

"staging"

days_to_expire
integer | null

Number of days until expiry, up to 3650. Use null for never.

Required range: 1 <= x <= 3650
Example:

30

project_id
string | null

Unique project identifier

Example:

"proj_abc123"

Response

API key created successfully

API key returned immediately after creation. Includes the plaintext key once.

id
string
required

Unique API key identifier

Example:

"ckv9w8q2f000001l5r3j7k9m4"

name
string
required

API key name

Example:

"production"

created_at
string<date-time>
required

When the API key was created

created_by
object
required
expires_at
string<date-time> | null
required

When the API key expires

project_id
string | null
required

Project identifier for project-scoped API keys. Null means org-wide.

Example:

"proj_abc123"

project_name
string | null
required

Project name for project-scoped API keys. Null means the key is org-wide or the project name is unavailable.

Example:

"Production"

masked_key
string
required

Masked version of the API key

Example:

"sk_1234...abcd"

key
string
required

Plaintext API key. Only returned once when the key is created.

Example:

"sk_1234abcd"