The authenticated entity lacks sufficient permissions for the requested operation
Example
Copy
Ask AI
{ "meta": { "requestId": "req_2c9a0jf23l4k567" }, "error": { "detail": "The authenticated API key does not have permission to perform this operation", "status": 403, "title": "Forbidden", "type": "https://unkey.com/docs/api-reference/errors-v2/unkey/authorization/insufficient_permissions" }}
This error occurs when your API key is valid and properly authenticated, but it doesn’t have the necessary permissions to perform the requested operation. In Unkey, different API keys can have different permission levels.Common scenarios that trigger this error:
Using a read-only key to perform write operations
Using a key limited to specific resources to access other resources
Attempting to access resources across workspaces with a workspace-scoped key
Using a key with limited permissions to perform administrative actions
Here’s an example of a request using a key with insufficient permissions:
Copy
Ask AI
# Using a read-only key to create a new API keycurl -X POST https://api.unkey.com/v1/keys.createKey \ -H "Content-Type: application/json" \ -H "Authorization: Bearer unkey_READ_ONLY_KEY" \ -d '{ "apiId": "api_123", "name": "New API Key" }'