Add permissions to a key without affecting existing permissions.
Use this for privilege upgrades, enabling new features, or plan changes that grant additional 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 permissions 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 receives the additional permissions 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"
Grants additional permissions to the key through direct assignment or automatic creation. Duplicate permissions are ignored automatically, making this operation idempotent.
Adding permissions never removes existing permissions or role-based permissions.
Any permissions that do not exist will be auto created if the root key has permissions, otherwise this operation will fail with a 403 error.
1 - 1000 elementsSpecify the permission by its slug.
3Permissions added 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 (including both newly added permissions and those that were already assigned).
This response includes:
Important notes:
/v2/keys.getKey instead