Skip to main content
POST
/
api
/
secrets
/
anon-key
/
rotate
Rotate anon key
curl --request POST \
  --url https://api.example.com/api/secrets/anon-key/rotate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "gracePeriodHours": 168
}
'
{
  "success": true,
  "message": "Anon key rotated successfully. Old key will remain valid during grace period.",
  "anonKey": "anon_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd",
  "oldKeyExpiresAt": "2026-06-18T00:00:00.000Z"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
gracePeriodHours
integer
default:168

How long the old key remains valid after rotation

Required range: 0 <= x <= 720

Response

Anon key rotated successfully

success
boolean
message
string
anonKey
string

The new anon key

oldKeyExpiresAt
string<date-time>

When the previous key stops being accepted