Update role
Update the name or description of a role, identified by its ID or name.
Omitted fields keep their current values. A request with no fields to update returns the stored role without a write.
This endpoint does not change the role’s permissions or keys. Use permissions.setRolePermissions, keys.addRoles, and keys.removeRoles for those.
Important: Keys keep the role after a rename. Requests that name the role, such as keys.addRoles, must use the new name. Key verification can return the old name for a short time while caches refresh. A name that another role in your workspace already uses returns 409.
Required Permissions
Your root key must have the following permission:
unkey:v1:<workspace_id>:projects/<project_id>/rbac/roles/<role_id>#write
Authorizations
Unkey uses bearer tokens for authentication. Public integrations use root keys, while the dashboard proxy uses short-lived JWTs. To authenticate, include the token in the Authorization header of each request:
Root keys have specific permissions attached to them, controlling what operations they can perform. Resource permissions use Unkey Resource Names plus actions, like unkey:v1:ws_123:projects/*/keyspaces/*/keys/*#write.
Security best practices:
- Keep root keys secure and never expose them in client-side code
- Use different root keys for different environments
- Rotate keys periodically, especially after team member departures
- Create keys with minimal necessary permissions following least privilege principle
- Monitor key usage with audit logs.
Body
Response
Role updated successfully