Skip to main content
POST
Create an API key in this organization

Authorizations

Authorization
string
header
required

Session token as Authorization: Bearer (the CLI and scripts).

Path Parameters

orgSlug
string
required

Body

application/json
name
string
required
Required string length: 1 - 32
level
enum<string>
required
Available options:
user,
organization,
workspace
workspaceSlug
string
role
enum<string>
Available options:
admin,
member,
viewer
expiresInDays
integer
Required range: 1 <= x <= 365

Response

Created

id
string
required
name
string
required
prefix
string | null
required

The first 15 characters of the key, for display; keys minted before this was stored hold only 01ads_

level
enum<string>
required
Available options:
user,
organization,
workspace
role
enum<string> | null
required
Available options:
admin,
member,
viewer,
null
workspace
string | null
required

Workspace name (workspace keys)

workspaceSlug
string | null
required

Workspace slug (workspace keys)

creatorEmail
string
required

Who created the key

status
enum<string>
required

Effective status; expired once the expiry has passed

Available options:
active,
disabled,
expired,
revoked
createdAt
string
required
expiresAt
string | null
required

ISO timestamp, or null = never

lastRequest
string | null
required
key
string
required

The raw key — shown exactly once