---
title: "Modify User Role Assignments"
url: "https://public-api-docs.cipherscale.com/apis/cipherscale-api-1/versions/fef69080-6094-4620-8bf0-16fd2de7b598/operations/UsersController_patchUserRoles"
---

> Full API specification: https://public-api-docs.cipherscale.com/apis/cipherscale-api-1/versions/fef69080-6094-4620-8bf0-16fd2de7b598.md

# Modify User Role Assignments

`PATCH` `/tenants/users/{id}/roles`

Operation ID: `UsersController_patchUserRoles`

Adds or removes roles from a user's account. This operation allows administrators to dynamically adjust user permissions by modifying their role assignments. Changes take effect immediately and affect the user's access to system resources.

## Path parameters

- `id` (string, required)

## Request body (required)

Content types: `application/json`

## Responses

- `200`
- `401` - Unauthorized - Invalid or missing authentication token
- `403` - Forbidden - Insufficient permissions to perform this operation.
- `404` - User not found with the provided ID

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Cipherscale API
  version: "1.0"
servers:
  - url: https://public-api.cipherscale.com/qa
    description: Cipherscale Public API Server
paths:
  /tenants/users/{id}/roles:
    patch:
      operationId: UsersController_patchUserRoles
      summary: Modify User Role Assignments
      description: Adds or removes roles from a user's account. This operation allows
        administrators to dynamically adjust user permissions by modifying their
        role assignments. Changes take effect immediately and affect the user's
        access to system resources.
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateUserRolesDto"
      responses:
        "200":
          description: ""
        "401":
          description: Unauthorized - Invalid or missing authentication token
        "403":
          description: Forbidden - Insufficient permissions to perform this operation.
        "404":
          description: User not found with the provided ID
      tags:
        - Users
      security:
        - ApiKeyAuth: []
security:
  - ApiKeyAuth: []
components:
  schemas:
    UpdateUserRolesDto:
      type: object
      properties:
        addedRoles:
          type: array
          items:
            type: string
        removedRoles:
          type: array
          items:
            type: string
      required:
        - addedRoles
        - removedRoles
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
```
