Skip to content
Documentation
Get started

Settings

Rotate the calling secret key

POST
/v1/api-keys/rotate
curl --request POST \
--url https://api.timbro.do/v1/api-keys/rotate \
--header 'Authorization: Bearer <token>' \
--header 'idempotency-key: example'

Issues a replacement for the calling secret key, returned only in this response, and keeps the calling key authenticating for 24 hours. Every other key is unchanged.

idempotency-key
required
string
>= 1 characters <= 255 characters /^[\x20-\x7e]+$/

The replacement for the calling secret key. Store it securely; it is never returned again.

Media typeapplication/json
Response fields and codes

The replacement for the calling secret key. Store it securely; it is never returned again.

object
id
required

API key identifier.

string
/^api_key_[0-9a-hjkmnp-tv-z]{24,}$/
object
required
string
Allowed value: api_key
kind
required
string
Allowed value: secret_key
capabilities
required
Array
unique items
mode
required
Any of:
string
Allowed value: test
name
required
Any of:
string
>= 1 characters <= 80 characters
secret
required

The new secret key. Returned only when it is issued.

string
/^sk_(?:test|live)_[A-Za-z0-9_-]+$/
createdAt
required
string format: date-time
retiredKeyExpiresAt
required

When the calling key this rotation replaced stops authenticating.

string format: date-time
request-id
required
string

Identifies this request. Quote it when you contact support.

Idempotent-Replayed
string
Allowed value: true

true when this response replays the stored result of an earlier request with the same Idempotency-Key.