Skip to main content
POST
Create API key

Authorizations

X-API-Key
string
header
required

Path Parameters

organization_id
string<shortuuid>
required

Organization ID.

Required string length: 22
Pattern: ^[23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{22}$

Body

application/json
name
string
required

Name for the new API key.

Required string length: 1 - 255
Pattern: ^[^\x00]{1,255}$
description
string
default:""

Optional description.

Maximum string length: 255
Pattern: ^[^\x00]{0,255}$
role
enum<string>
default:readonly

Permission role for this key within the organization.

Available options:
manager,
editor,
readonly

Response

OK

id
string<shortuuid>
required

URL-safe 22-character shortuuid encoding of the row's UUID primary key. Stable across the row's lifetime; suitable for sharing in URLs, log lines, and external SDK clients. Accepted on input as either the shortuuid form or the canonical UUID form (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

Required string length: 22
Pattern: ^[23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{22}$
name
string
required

Key name.

role
enum<string>
required

Permission role for this key within the organization.

Available options:
manager,
editor,
readonly
created
string
required

ISO 8601 creation timestamp.

is_active
boolean
required

False once the key has been revoked; a revoked key is refused.

key
string
required

The raw API key value. Only shown once at creation time.

metadata
Metadata · object

Developer-attached key/value data attached to this object. Up to 50 keys; key max 40 chars, value max 500 chars.

description
string
default:""

Key description.

last_used
string | null

ISO 8601 timestamp of the key's last use, if it has been used.

expires_at
string | null

ISO 8601 expiry timestamp, if the key expires.

grants
APIKeyGrantOut · object[]

Permissions an Owner granted this key beyond its role. Empty for almost every key: no role carries these, and a key gains one only when an Owner grants it.