POST
Error

Authorizations

apikey
string
header
required

Your publishable (pb_pk_…) or secret (pb_sk_…) key.

Authorization
string
header
required

The signed-in person's access token.

Body

application/json
name
string
required

A label so you can recognise the key later.

Required string length: 1 - 120
scopes
string[]

What the key may do, from the scope catalogue (GET /keys/scopes). Leave empty for the role's defaults.

Maximum array length: 50
expires_in_days
integer | null

Days until the key stops working. Leave out for never.

Required range: 1 <= x <= 3650
org
string | null

Restrict the key to one organization (its slug). Leave out to act as the user in every organization.

Maximum string length: 63

Response

Created. The body is the new object.

id
string
required

Unique identifier.

name
string
required

The name.

prefix
string
required
scopes
array
required

The scopes it grants.

org
null
required
status
string
required

Current status.

created_at
string<date-time>
required

When it was created (UTC).

expires_at
null
required

When it stops being valid.

last_used_at
null
required

When it was last used (UTC).

last_ip
null
required
use_count
integer
required
key
string
required