Skip to main content
POST
Create an API key

Authorizations

Authorization
string
header
required

Access token issued by WorkOS AuthKit.

Body

application/json
name
string
required

What this key is for, in the operator's words

Required string length: 1 - 100
expires_at
string<date-time> | null

When the key stops working on its own. Omitted or null for a key that only stops when it is revoked.

Response

The new key, including its token

id
string<uuid>
required
name
string
required
created_at
string<date-time>
required
expires_at
string<date-time> | null
required

When the key stops working, or null when it never does

created_by
UserResponse · object
required

The member whose role the key acts with. Demoting or removing them changes what the key can do.

token
string
required

The credential itself, to send in the X-API-Key header. Only the digest is stored, so this is the only time it is readable.