Revoke API Key
API Keys
Revoke API Key
Soft-revoke an API key (sets revoked_at, preserves the row for audit)
DELETE
Revoke API Key
Overview
Revokes an API key by setting itsrevoked_at timestamp. The row is preserved so audit logs and historical usage records remain valid. Once revoked, requests using the key return 401 unauthorized.
System keys cannot be revoked. Requires the api-keys:manage scope.
Path Parameters
API key ID (
key_...).Response
Echo of the revoked API key ID.
Always
api_key.Always
true on success.Code Examples
Revocation is irreversible. To roll a key without downtime, use
Rotate API Key — the old key remains valid for a 24-hour grace period.Errors
| Status | Type | Description |
|---|---|---|
| 400 | validation_error | Invalid API key ID |
| 401 | unauthorized | Missing or invalid API key |
| 403 | forbidden | API key lacks api-keys:manage or target is a system key |
| 404 | not_found | API key does not exist or belongs to another org |
Related Endpoints
- Rotate API Key — graceful key rotation
- List API Keys