v97

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-31135175384.2 KB
API Keys

Create an API key

Create a new API key within the authenticated organization.

post/org/api_keys

Request body

namestring required

Label for the API key (1-255 characters). API keys are not addressable by name.

days_to_expireinteger nullable

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

project_idstring nullable

Unique project identifier

Example request

{
  "name": "staging",
  "days_to_expire": 30,
  "project_id": "proj_abc123"
}

Response

API key created successfully

idstring required

Unique API key identifier

namestring required

Label for the API key. API keys are not addressable by name; use the ID or key identifier for stable references.

created_atstring date-time required

When the API key was created

expires_atstring date-time nullable required

When the API key expires

deleted_atstring date-time nullable required

When the API key was deleted (soft-deleted). Null for keys that have not been deleted.

project_idstring nullable required

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

project_namestring nullable required

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

masked_keystring required

Masked version of the API key

keystring required

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

Example response

{
  "id": "ckv9w8q2f000001l5r3j7k9m4",
  "name": "production",
  "created_by": {
    "id": "user-abc123",
    "email": "user@example.com",
    "name": "Jane Doe"
  },
  "project_id": "proj_abc123",
  "project_name": "Production",
  "masked_key": "sk_1234...abcd",
  "key": "sk_1234abcd"
}