/api-keys/{keyId}/rotateMakes a new key with the same name, scopes and expiry, and retires the old one, at once or after 24 hours.
collector.rotateMyApiKey()Idempotency-KeyX-Request-IdkeyIdstring (uuid)requiredgraceHours"0" or "24"Keep the old key working this many hours, so integrations can switch over.
default 0
Option 1: "0"
Option 2: "24"
201CreatedThe new key (shown once) and the old one.
A rotated key: the new one (shown once) and the one it replaces.
tokenstringrequiredThe new key. Store it now: it can’t be shown again.
invalid_requestinvalid_jsoninvalid_idempotency_key
invalid_request: The query or body doesn’t match the schema (see errors[]).
invalid_json: The body isn’t JSON.
invalid_idempotency_key: The Idempotency-Key isn’t 1–255 visible ASCII characters.
unauthorized: Not signed in (no session or token, or an expired one).
not_found: Nothing at that address.
idempotency_in_progresssecret_already_issuedkey_not_active
idempotency_in_progress: The first request with this key is still running.
secret_already_issued: A retry of a request that already succeeded: its secret is shown only once, so it isn’t answered again. issued is what was made; rotate it for a new secret.
key_not_active: The key is revoked, expired or already rotating.
payload_too_large: The body is over 1,048,576 bytes, this operation’s limit.
idempotency_key_reused: This key was used for a different request.
rate_limitedtemporarily_blocked
rate_limited: Over the caller’s limit: the per-minute burst or the per-day quota (RateLimit headers; wait Retry-After seconds).
temporarily_blocked: Too many refused requests in a row: blocked for a while (Retry-After says how long).
internal: Something went wrong on our side (quote the requestId).
api_keys_unavailable: This deployment isn’t set up for API keys.