Skip to main content
err:unkey:data:role_not_found
A role you referenced doesn’t exist in your workspace. You get HTTP 404, and detail names the role.
Example response

Likely causes

  • You attached a role to a key before creating it. The request stops at the first missing role.
  • The name has a typo. Names aren’t case-sensitive, so Admin finds admin.
  • Your root key can’t read the role. permissions.getRole and permissions.deleteRole return this 404 instead of a 403. A key that can read the role but lacks the action gets a 403 err:unkey:authorization:insufficient_permissions that names the missing permission.

How to fix

  1. Create the role with permissions.createRole before you reference it.
  2. Check the name. permissions.listRoles shows what exists.
  3. On permissions.getRole or permissions.deleteRole, check the root key’s permissions before you decide the role is missing.
Last modified on October 27, 2026