Skip to main content
POST
Rotate a key

Authorizations

Authorization
string
header
required

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

Path Parameters

orgSlug
string
required
id
string
required

Body

application/json
graceHours
integer

Hours the old key keeps working; 0 (default) revokes it immediately

Required range: 0 <= x <= 168
expiresInDays
integer

Expiry of the new key; defaults to the old key's expiry when still ahead

Required range: 1 <= x <= 365

Response

Rotated

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