> ## 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.

# Delete Role



## OpenAPI

````yaml DELETE /api/v1/mgt/workspaces/{workspaceId}/roles/{roleId}
openapi: 3.1.0
info:
  title: Xenia Team API - Delete Role
  description: Soft-delete a role and reassign its users to a new role
  version: 1.0.0
servers:
  - url: https://api.xenia.team
security: []
paths:
  /api/v1/mgt/workspaces/{workspaceId}/roles/{roleId}:
    delete:
      tags:
        - Roles
      summary: Delete Role with Reassignment
      description: Soft-deletes a role and reassigns users to a new role
      parameters:
        - name: workspaceId
          in: path
          required: true
          description: Workspace ID
          schema:
            type: string
            format: uuid
        - name: roleId
          in: path
          required: true
          description: ID of the role to delete
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                newRoleId:
                  type: string
                  format: uuid
                  description: Role ID to which existing users will be reassigned
              required:
                - newRoleId
            example:
              newRoleId: a0bb13ef-7362-41b2-9947-a9146adb243d
      responses:
        '200':
          description: Role deleted and users reassigned
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: integer
                    description: Number of affected records
                  meta:
                    type: object
              example:
                data: 1
                meta: {}
        '400':
          description: Bad Request - Invalid input or cannot delete default role
        '401':
          description: Unauthorized - Missing or invalid authentication
        '403':
          description: Forbidden - Insufficient permissions
        '404':
          description: Not Found - Role does not exist
        '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

````