key_revoked means you tried to rotate a key that has already been revoked. Read this page if a rotation script fails with a 409.
What happened
Route:POST /v1/keys/{key_id}/rotate.
Revoking a key is final. A revoked key cannot be rotated, re-enabled or given a new secret; it stays in the key list with state: "revoked" as an audit record. Nothing changed.
This code appears only on rotation. A request authenticated with a revoked key gets invalid_credential, not key_revoked.
How to fix
- Create a new key with
POST /v1/keys, with the scopes the old key had. The old key’sscopesare still listed on it. - Store the new
secret; it is shown once. - Deploy it to the services that used the old key.
state is revoked before calling rotate.
Example
keys_read and keys_write.
Related
- Key rotation - rotate in place or overlap two keys.
- API keys in the console - see which keys are active or revoked.
- invalid_credential - what a request made with a revoked key gets.
- Problem codes - every code, its status, and whether a retry can help.