a021527e00d2

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-1379284707.0 KB
permissions

Set role permissions

Atomically 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 body

roleIdstring required

Identifies a resource by either its unique ID or its slug. Accepts a prefixed ID (such as 'proj_' or 'app_') or a slug.

permissionsstring[] required

The complete set of permission slugs to assign directly to the role. Missing permissions are created when authorized. An empty array clears all direct permissions.

Example request

{
  "roleId": "proj_1234abcd"
}

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"
    }
  ]
}