Skip to content

Rotate an API key

POST
/v1/keys/{id}/rotate
curl --request POST \
--url https://api.disasm.dev/v1/keys/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rotate \
--header 'Authorization: Bearer <token>'

Replaces the key. The old key stops working at once. The new key is returned once only, so store it.

id
required
string format: uuid

The API key ID (UUID).

The key was rotated. The new plaintext key is returned once.

Media typeapplication/json
object
key
object
id
string
key_hint
string
label
string
status
string
request_balance
integer
plaintext

The new key. Returned once only.

string
message
string

Example

{
"key": {
"id": "new-key-uuid",
"key_hint": "dk_live_****wxyz",
"label": "Production",
"status": "active",
"request_balance": 5000
},
"plaintext": "dk_live_aBcDeFgHiJkLmNoPqRsTuVwXyZ012345",
"message": "Key rotated successfully. Save the new key; it will not be shown again."
}
X-RateLimit-Limit
integer
Example
60

Maximum requests per minute (60).

X-RateLimit-Remaining
integer
Example
59

Requests remaining in the current window.

X-RateLimit-Reset
integer
Example
1718000000

Unix timestamp when the rate limit resets.

Missing or invalid API key.

Media typeapplication/json
object
error

A human-readable message describing what went wrong.

string

Example

{
"error": "Missing or invalid API key"
}

The requested resource does not exist or does not belong to you.

Media typeapplication/json
object
error

A human-readable message describing what went wrong.

string

Example

{
"error": "API key not found"
}

Rate limit exceeded. See the X-RateLimit-* response headers.

Media typeapplication/json
object
error

A human-readable message describing what went wrong.

string

Example

{
"error": "Rate limit exceeded"
}
X-RateLimit-Limit
integer
Example
60

Maximum requests per minute (60).

X-RateLimit-Remaining
integer
Example
59

Requests remaining in the current window.

X-RateLimit-Reset
integer
Example
1718000000

Unix timestamp when the rate limit resets.