API Keys
Rotate an API key
Atomically replaces the key's secret (GH#485): the key keeps its id, name, workspace pin and expiry; the old secret stops authenticating the moment this call returns; the new secret is in key_value — shown only in this response. Prefer this over delete-and-recreate: the key's identity survives and there is no window with zero valid credentials. last_used resets to null because the new secret has never been used.
Accepts either a session cookie or an existing API key as auth. A key can rotate itself.
post/api/keys/{id}/rotate
Request
- Base URL: https://www.audioscrape.com
- URL: https://www.audioscrape.com/api/keys/{id}/rotate
- Auth: HTTP bearer
Path parameters
idinteger required
API key ID (from the id field on create / list)
Response
Key rotated. key_value holds the NEW secret, shown in full here for the only time.
Example response
{
"created_at": "2026-05-16T08:30:00Z",
"key_name": "acme-dev-connector-v1",
"key_prefix": "sk_abc123def...",
"key_value": "sk_abc123base64encodedrandombytes...",
"last_used": "2026-05-16T08:30:00Z",
"last_used_ip": "203.0.113.7",
"workspace_id": 42
}Changes
No recorded changes to this operation across all 1 revision of this API.