POST
/
api-keys
/
{keyId}
/
rotate
Rotate an API key
curl --request POST \
  --url https://your_salambo_base_url/api/v1/api-keys/{keyId}/rotate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "label": "<string>",
  "scopes": [
    "<string>"
  ],
  "gracePeriodSeconds": 302400
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "object": "<string>",
  "key_prefix": "<string>",
  "scopes": [
    "<string>"
  ],
  "created_at": 123,
  "key": "<string>",
  "label": "<string>",
  "last_used_at": 123,
  "revoked_at": 123,
  "updated_at": 123,
  "old_key_revokes_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

keyId
string<uuid>
required

Body

application/json
label
string | null
Maximum string length: 80
scopes
string[]
Required array length: 1 - 16 elements
mode
enum<string>
Available options:
live,
test
gracePeriodSeconds
integer
Required range: 0 <= x <= 604800

Response

Replacement key with one-time secret

id
string<uuid>
required
object
string
required
Allowed value: "api_key"
key_prefix
string
required
scopes
string[]
required
mode
enum<string>
required
Available options:
live,
test
created_at
integer
required
key
string

Returned only when a key is created or rotated.

label
string | null
last_used_at
integer | null
revoked_at
integer | null
updated_at
integer
old_key_revokes_at
string<date-time>

Returned only when a key is rotated.