---
title: "Assign a role to user"
method: POST
path: "/v1/{organization}/role/{role_name}/assign"
tags: ["Role"]
---

# Assign a role to user

`POST /v1/{organization}/role/{role_name}/assign`

Assign a role to a user.

#### Permissions
This endpoint requires the following permissions:
* The authenticated user to have greater privileges than the role being assigned.

## Path parameters

- `organization` string, required
- `role_name` string, required — The name of the role to assign.

## Headers

- `x-mongo-cluster-name` string, nullable — The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
- `Sec-WebSocket-Protocol` string[]

## Request body

- SrcAppEndpointsRoleAssignRoleRequest
  - `user_id` string, required — The identifier of the user to assign the role to.

## Response `200`

Succeeded

- SrcAppEndpointsRoleAssignRoleResponse
  - `role_id` string, required — The identifier of the role assigned to the user.

## Other responses

- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — Specified organization, role, or user is not found.
- `422` — Invalid request path parameter or request body failed validation.
- `429` — The user has exceeded the rate limit of 1000 requests per minute for this endpoint.
- `503` — The service is going through temporary maintenance.

---

[API](https://skmtc.net/amigo/apis/amigo-api.md) · [All operations](https://skmtc.net/amigo/apis/amigo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/amigo/amigo-api/revisions/f0f28319e448/schema)
