permissions
Set role permissions
Changed onAtomically replaces all permissions directly assigned to a role. An empty permissions array removes every permission from the role. Permissions that do not exist are created when the caller has permission to create them.
Required Permissions
Your root key must have:
- rbac.*.add_permission_to_role
- rbac.*.remove_permission_from_role
When any requested permission slug does not exist, it must also have:
- rbac.*.create_permission
post/v2/permissions.setRolePermissions
Request
- Base URLhttps://api.unkey.com
- URLhttps://api.unkey.com/v2/permissions.setRolePermissions
- AuthHTTP bearer
Request body
Response
Permissions set successfully.
Example response
{
"meta": {
"requestId": "req_123"
},
"data": [
{
"id": "perm_1234567890abcdef",
"name": "users.read",
"slug": "users-read",
"description": "Allows reading user profile information and account details"
}
]
}Changes
- breaking
the
request property's maxLength was decreased to128 - info
added the new optional request property
- info
added
subschema #1subschema #2to the request bodyoneOflist - info
the request property
became optional - info
request property
deprecated - info
the
request property's minLength was decreased from3to1 - info
removed the pattern
^[a-zA-Z0-9_-]+$from the request property
- breaking
- info
endpoint added
- info