> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xenia.team/llms.txt
> Use this file to discover all available pages before exploring further.

# Change User Role

> Updates the role of a specific user in the workspace. Ensures the action is permissible based on peer or subordinate roles and business logic constraints.



## OpenAPI

````yaml PATCH /api/v1/mgt/workspaces/{workspaceId}/users/{userId}/role/{roleId}
openapi: 3.1.0
info:
  title: Xenia Team API - Change User Role
  description: >-
    Update a user's role in the workspace. Only authorized users with the
    required permissions can perform this action.
  version: 1.0.0
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/mgt/workspaces/{workspaceId}/users/{userId}/role/{roleId}:
    patch:
      tags:
        - Users
      summary: Change User Role
      description: >-
        Updates the role of a specific user in the workspace. Ensures the action
        is permissible based on peer or subordinate roles and business logic
        constraints.
      parameters:
        - name: workspaceId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The ID of the workspace
        - name: userId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The ID of the user whose role needs to be updated
        - name: roleId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The ID of the new role to assign to the user
      responses:
        '200':
          description: User role updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      isAdmin:
                        type: boolean
                  extra_meta:
                    type: object
                    properties:
                      message:
                        type: string
              example:
                data:
                  id: a4f9e150-26ee-40f5-bbdd-a47232fef68a
                  isAdmin: false
                extra_meta:
                  message: User's role updated!
        '400':
          description: >-
            Bad Request - Invalid request or role update constraints not
            satisfied
        '401':
          description: Unauthorized - Missing or invalid authentication
        '403':
          description: Forbidden - Insufficient permissions
        '404':
          description: Not Found - User or role not found
        '500':
          description: Internal Server Error
      security:
        - clientKey: []
          clientSecret: []
components:
  securitySchemes:
    clientKey:
      type: apiKey
      in: header
      name: x-client-key
      description: Client API key for authentication
    clientSecret:
      type: apiKey
      in: header
      name: x-client-secret
      description: Client secret for authentication

````