Skip to main content
POST
/
api-keys
/
{id}
/
rotate
Rotate API key
curl --request POST \
  --url https://api.sevalla.com/v3/api-keys/{id}/rotate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "old_token_ttl_hours": 24
}
'
{
  "token": "svl_abc123...",
  "name": "My API Key"
}

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token in the Authorization header.

Path Parameters

id
string<uuid>
required

API key identifier

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Example:

"fb5e5168-4281-4bec-94c5-0d1584e9e657"

Body

application/json
old_token_ttl_hours
integer
default:0

Number of hours to keep the old token valid after rotation (0-168). Set to 0 to immediately invalidate the old token

Required range: 0 <= x <= 168
Example:

24

Response

Default Response

token
string
required

The new raw API key token. This is the only time the full token is returned - store it securely

Example:

"svl_abc123..."

name
string
required

Name of the rotated API key

Example:

"My API Key"