staqlydocs
REST APIAPI referenceAuth

Revoke a key and issue a replacement with the same name and scopes

Revoke a key and issue a replacement with the same name and scopes (admin)

Every request sends Authorization: Bearer ...: the access token in local mode, an API key stk_... in cloud mode. Use Send to try it against your cloud instance with your API key.

POST
/v1/api-keys/{id}/rotate

Cloud only; the Community Edition (local mode) has no API keys (409).

Authorization

headerAuthorizationBearer <token>

API key (stk_...), or in the Community Edition the access token (stk_local_...)

Path Parameters

id*string

Header Parameters

Idempotency-Key?string

Replays the stored response when the same key is repeated with the same method, path, query string and body within 24 hours (422 idempotency_mismatch with a different request, 409 idempotency_in_progress while the first one runs). Not applied to multipart uploads or to responses that carry a secret.

Lengthlength <= 200

Response Body

New key

application/json
  1. response
id*string
name*string
prefix*string
scopes*array<>
created_at*string
last_used_at*string|null
expires_at*string|null
revoked_at*string|null
key?string

Raw secret; only in create/rotate responses

curl -X POST 'https://staqly.example.com/v1/api-keys/string/rotate'
{  "id": "string",  "name": "string",  "prefix": "string",  "scopes": [    "collections:read"  ],  "created_at": "string",  "last_used_at": "string",  "expires_at": "string",  "revoked_at": "string",  "key": "string"}