---
title: "Set role assignments."
method: PUT
path: "/access-control/roles/{roleUID}/assignments"
tags: ["access_control", "enterprise"]
---

# Set role assignments.

`PUT /access-control/roles/{roleUID}/assignments`

## Request

- Base URL: `/api` (relative, and the document’s source URL is not known)
- URL: `/api/access-control/roles/{roleUID}/assignments`
- Auth: one of:
  - HTTP basic
  - API key in header `Authorization`

Set role assignments for the role with the given UID.

You need to have a permission with action `teams.roles:add` and `teams.roles:remove` and scope `permissions:type:delegate`, and `users.roles:add` and `users.roles:remove` and scope `permissions:type:delegate`.

## Path parameters

- `roleUID` string, required

## Request body

- SetRoleAssignmentsCommand
  - `service_accounts` integer[]
  - `teams` integer[]
  - `users` integer[]

## Response `200`

(empty)

- RoleAssignmentsDTO
  - `role_uid` string
  - `service_accounts` integer[]
  - `teams` integer[]
  - `users` integer[]

## Other responses

- `403`: ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource.
- `404`: NotFoundError is returned when the requested resource was not found.
- `500`: InternalServerError is a general error indicating something went wrong internally.

---

[API](https://skmtc.dev/grafana/apis/grafana-http-api.md) - [All operations](https://skmtc.dev/grafana/apis/grafana-http-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grafana/apis/grafana-http-api/revisions/df55ba1718ba?raw)
