Skip to main content
POST
Rotate an API key for a service account

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

name
string
required
key_id
string
required
org
string
required

Body

application/json
grace_period_hours
integer
default:24

Number of hours the old key remains valid after rotation. Defaults to 24.

Required range: 1 <= x <= 720
expires_at
integer | null

Unix timestamp for the new key's expiry. Must not be in the past. Omit to keep the current key's expiry, bounded to at most 365 days from now.

Required range: -9223372036854776000 <= x <= 4102444800

Response

Successful Response

id
string
required

The key's id.

description
string
required

The name given to the key.

created_at
number
required

Unix time the key was created.

expires_at
integer
required

Unix time the key expires. 0 means it never expires.

grace_period_expires_at
integer
required

Unix time the secret replaced by this rotation stops working.

key
string
required

The key's secret. It is only returned once.

last_used_at
number | null

Unix time the key was last used. Absent if it never has been.

generated_at
number | null

Unix time the key's current secret was generated: when it was created, or when it was last rotated. Absent if the key was rotated before this time was recorded.