---
title: "Assign custom user role"
method: POST
path: "/api/{cloudId}/v1/roles/assign"
tags: ["Custom user roles"]
---

# Assign custom user role

`POST /api/{cloudId}/v1/roles/assign`

Assignes a custom user role to a user. 
 - The user should have admin role and custom user role right. 
 - Assignment on the admin roles can be done through Atlassian Administration.

## Request body

- AssignRoleRequest
  - `accountId` string, required — The accountId of the user to assign the role to.
  - `roleId` string, required — The id of the role to assign.

## Response `200`

Returned if the request is successful.

- CustomRolesPaginatedResponse
  - `values` object[] — The list of response values.
  - `_expands` string[]
  - `links` CustomRolesLinks
    - `next` string
    - `first` string
    - `last` string

## Other responses

- `400` — Returned if an field is not properly set.
- `403` — Returned if the request user does not have permission to assign a custom user role.
- `404` — Returned if the role with the identifier cannot be found.
- `422` — Returned if the requested identifier doesn't belong to custom user role.

---

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