Skip to content

Create rotate

POST
/api-keys/{id}/rotate
curl --request POST \
--url https://api.testzilla.ai/v1/api-keys/example/rotate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{}'
id
required
string

Id identifier

No request body. The key to rotate is identified by the id path parameter.

Media type application/json
object
Example generated
{}

Key rotated. The new raw apiKey is returned here once; the previous secret is now invalid.

Media type application/json

One-time response carrying the raw secret API key. Returned ONLY on create and rotate, and never again — the raw key is not stored and cannot be retrieved later.

object
success
required
boolean
id
required

Key identifier (Firestore doc id).

string
label
required

The key label.

string
prefix
required

Non-secret display prefix, e.g. “tz_a1b2c3d4”.

string
apiKey
required

The raw secret API key. Shown EXACTLY ONCE. Store it immediately; it cannot be recovered afterwards.

string
warning
required

Human-readable reminder that the key will not be shown again.

string
Example
{
"success": true
}

Unauthorized (missing or invalid API key)

API key not found.

Media type application/json
object
error
required

Human-readable error message.

string
Example generated
{
"error": "example"
}

Cannot rotate a revoked key.

Media type application/json
object
error
required

Human-readable error message.

string
Example generated
{
"error": "example"
}