err:unkey:authorization:insufficient_permissionsdetail shows the permission that was missing, with resource IDs replaced by their prefix in braces, such as {api} or {ks}. Substitute the ID from your own request.
Example response
Likely causes
- The root key was never given this permission.
- The permission names the wrong resource ID, for example an API ID where the URN needs a keyspace ID.
- The request asks for a broader scope than the key’s permission, such as listing deployments without environment filters.
- Someone saved the key in Edit root key and left the permission unchecked. Saving replaces the whole set.
detail names the missing permission. Check the root key’s permissions before you decide the ID is wrong.
How to fix
- Identify the required resource and action. In
unkey:v1:{workspace_id}:{resource_path}#{action}, the path selects the resource and the part after#selects the action. - Check the workspace and resource IDs, including every parent in the path. Narrow the request’s filters if it asks for more resources than the task needs.
- Assign the missing permission through the dashboard or API. For example,
unkey:v1:ws_demo:projects/proj_shop/keyspaces/ks_customers/keys/*#writepermits creating and updating keys in one keyspace. Replace the example IDs with your own.
keys.verifyKey distinguishes the root key’s access from your customer’s permissions. If the root key lacks verify access, the response has valid: false and code NOT_FOUND. If the customer’s key lacks a permission required by your verification query, the code is INSUFFICIENT_PERMISSIONS.
Related errors
err:unkey:authorization:forbidden: the operation isn’t allowed for a reason other than a missing permission.err:unkey:authentication:key_not_found: the bearer token isn’t a root key at all.err:user:bad_request:permissions_query_syntax_error: a permissions query you wrote forkeys.verifyKeycouldn’t be parsed.