Remove permissions from a key without affecting existing roles or other permissions.
Use this for privilege downgrades, removing temporary access, or plan changes that revoke specific capabilities. Permissions granted through roles remain unchanged.
Important: Changes take effect immediately with up to 30-second edge propagation.
Required Permissions
Your root key must have one of the following permissions:
api.*.update_key (to update keys in any API)api.<api_id>.update_key (to update keys in a specific API)Side Effects
Invalidates the key cache for immediate effect, and makes permission changes available for verification within 30 seconds across all regions.
Unkey uses API keys (root keys) for authentication. These keys authorize access to management operations in the API. To authenticate, include your root key in the Authorization header of each request:
Authorization: Bearer unkey_123Root keys have specific permissions attached to them, controlling what operations they can perform. Key permissions follow a hierarchical structure with patterns like resource.resource_id.action (e.g., apis.*.create_key, apis.*.read_api).
Security best practices:
Specifies which key to remove permissions from using the database identifier returned from keys.createKey.
Do not confuse this with the actual API key string that users include in requests.
3 - 255"key_2cGKbMxRyIzhCxo1Idjz8q"
Removes direct permissions from the key without affecting role-based permissions.
You can either use a permission slug, or the permission ID.
After removal, verification checks for these permissions will fail unless granted through roles.
1 - 1000 elementsSpecify the permission by its slug.
3Permissions removed successfully. Returns all permissions currently assigned to the key.
Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The requestId is particularly important when troubleshooting issues with the Unkey support team.
Complete list of all permissions directly assigned to the key after the removal operation (remaining permissions only).
Notes:
/v2/keys.getKey instead