Revoking a key
You can revoke a key in the console (API keys) or with the API. Revoking is permanent for that key.
- After the API confirms success, the key is rejected on the next request.
- Other keys keep working.
- A request that already started may finish.
- If a response is lost, refresh the key list or retry the same revocation. It is safe to repeat.
- There is no reactivation, no secret recovery and no automatic rotation. Create a new key instead.
Removing someone's console access does not revoke an application key. Revoke the key itself.
DELETE /v1/keys/{id}
Needs a console session, not an API key. Example, with placeholders only:
DELETE /v1/keys/<key-id>
Authorization: Bearer <console-session-token>{
"key": {
"id": "<key-id>",
"name": "<key-name>",
"prefix": "opk_xxxx",
"created_at": "<timestamp>",
"state": "revoked"
},
"request_id": "<request-id>"
}- Repeating the call on an already revoked key returns the same key details.
- An unknown id, or a key from another account, returns
404 resource_not_found. - Keys can expire. Choose 30, 60, 90 or 365 days, or Never, when you create one (
expires_in_days, default 30). An expired key gets401 key_expired: create a new key. - A revoked key used on
/v1/detectgets401 unauthorized. - If the access check cannot run you get
503 access_check_unavailable. Retry shortly.