When a key is compromised or a user's access should end, you can revoke it immediately. Unkey supports both permanent deletion and temporary disabling.
When to use this#
Key was leaked in a public repo or logs. Delete it immediately.
Customer canceled or employee left. Revoke their API access.
Unusual traffic patterns. Disable the key while investigating.
Payment failed. Temporarily disable until resolved.
Delete vs Disable#
| Action | Effect | Reversible? | Use when |
|---|---|---|---|
| Delete | Permanently removes the key | No | Key is compromised, user churned |
| Disable | Key exists but can't authenticate | Yes | Temporary suspension, investigation |
Delete a key permanently#
Use when the key should never work again:
The key is invalidated within 60 seconds globally.
Deletion is permanent. The key cannot be recovered. If you might need to restore access, use disable instead.
Disable a key temporarily#
Use when you want to suspend access but may restore it later:
Verification response when disabled:
Re-enable a disabled key#
The key works again immediately.
Propagation time#
- Delete: Up to 60 seconds for global invalidation
- Disable: Up to 60 seconds for global propagation
For immediate revocation of a compromised key, you may want to also:
- Rotate any affected secrets downstream
- Review audit logs for unauthorized access
- Alert the user if appropriate
Bulk revocation#
To revoke all keys for a specific user, query their keys first:
For security incidents, consider using key rerolling if you need to maintain the user's configuration while replacing the compromised key.