---
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`

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.net/grafana/apis/http-api.md) · [All operations](https://skmtc.net/grafana/apis/http-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/grafana/http-api/versions/df55ba1718ba/schema)
