Rotate an API key: mint a replacement and revoke the predecessor, in one transaction.
const url = 'https://api.siteqwality.com/account/api_key/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rotate';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siteqwality.com/account/api_key/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rotate \ --header 'Authorization: Bearer <token>'Because the secret is hashed at rest there is no “reveal it again”, so rotation is how a customer recovers from a lost or leaked key. The new key inherits the old one’s name, type, scopes, and expiry, so a rotated credential drops straight into the same config slot.
The old secret stops working the moment this returns; there is no grace period. A caller that needs overlap should instead create a second key, deploy it, then revoke the first.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”API key identifier
Responses
Section titled “ Responses ”New key; the secret is only returned once
Response for create and rotate, the ONLY places a full secret ever appears. It is not stored and cannot be retrieved again.
object
One API key in list responses. Never contains the secret: after creation the secret exists only in the customer’s hands.
object
First 8 characters of the secret, kept in plaintext for display.
Last 4 characters of the secret, kept in plaintext for display.
What a customer API key is allowed to do.
Mirrors the Datadog split between an API key (telemetry push) and an application key (full API access), collapsed into one credential with a type so the ingest path and the management path can share a table.
Empty means unrestricted.
Lifecycle state of a key, derived rather than stored so it can never disagree with the timestamps.
The full secret. Shown exactly once; store it now.
Example
{ "api_key": { "key_type": "ingest", "status": "active" }}Missing or invalid authentication
API key not found or already revoked
Internal server error