---
title: "Assign a role to a list of users"
method: POST
path: "/roles/assign"
tags: ["roles"]
---

# Assign a role to a list of users

`POST /roles/assign`

This is a business/enterprise only endpoint

## Request body

- RolesAssign
  - `appBuilder` object — Allow setting users to builders per app.
    - `appId` string, required — The app that the users should have app builder privileges granted for.
  - `builder` boolean — Add/remove global builder permissions from the list of users.
  - `admin` boolean — Add/remove global admin permissions from the list of users.
  - `role` object — Add/remove a per-app role, such as BASIC, ADMIN etc.
    - `roleId` string, required — The role ID, such as BASIC, ADMIN or a custom role ID.
    - `appId` string, required — The app that the role relates to.
  - `userIds` string[], required — The user IDs to be updated to add/remove the specified roles.

## Response `200`

Returns a list of updated user IDs

- RolesOutput
  - `data` object, required
    - `userIds` string[], required — The updated users' IDs

## Changes

- **2023-08-15** `44fbe9f14200` — 3 breaking, 2 warning, 2 info
  - the `admin` request property type/format changed from `object`/`` to `boolean`/``
  - the `builder` request property type/format changed from `object`/`` to `boolean`/``
  - removed the required property `userIds` from the response with the `200` status
  - removed the request property `admin/global`
  - …3 more
- **2023-08-04** `9f4851dfc828` — 1 info
  - endpoint added
- **2023-03-06** `7de0ab0187e0` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/budibase/apis/budibase-api/changes/roles/assign/post.md)

---

[API](https://skmtc.dev/budibase/apis/budibase-api.md) · [All operations](https://skmtc.dev/budibase/apis/budibase-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/budibase/budibase-api/revisions/9c6f16fc652b/schema)
