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

# Update a role



## OpenAPI

````yaml https://dev.enneo.dev/api/mind/docs/open-api patch /roles/{id}
openapi: 3.0.0
info:
  version: '1'
  title: enneo.MIND API
  description: This describes the API of enneo Mind, the main ticketing backend
  contact:
    name: enneo GmbH
    email: richard@enneo.ai
  license:
    name: Proprietary software
    url: https://enneo.ai
servers:
  - url: https://demo.enneo.ai/api/mind
    description: Production server, demo client
  - url: https://main.enneo.dev/api/mind
    description: Development main branch
  - url: http://localhost:8005/api/mind
    description: Local development server
security:
  - bearerAuth:
      - api
  - cookieAuth:
      - api
paths:
  /roles/{id}:
    patch:
      tags:
        - Role
      summary: Update a role
      operationId: updateRole
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Role'
      responses:
        '200':
          description: Role updated successfully
        '403':
          description: Unauthorized
        '404':
          description: Role not found
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Role:
      type: object
      properties:
        name:
          type: string
          description: The name of the role
          example: Admin
        description:
          type: string
          description: The description of the role
          example: Handles administrative tasks
        baseRoleId:
          type: integer
          description: The ID of the base role
          example: 1
        permissions:
          type: array
          description: >-
            Permissions for this role. When reading: returns grouped permissions
            with labels. When writing: accepts array of permission names
          items:
            oneOf:
              - $ref: '#/components/schemas/PermissionGroup'
              - type: string
                example: createAiAgent
    Error:
      type: object
      description: Data format of Enneo error messages
      properties:
        error:
          type: string
          example: Contract 121 could not be processed
          description: Readable error message that should be shown to the user
        details:
          type: string
          example: >-
            Uncatched null point exception in testFunction() in
            /app/src/file:212
          description: Not easily readable error message that is for the developer
        txId:
          type: string
          example: c916167c94
          description: >-
            Internal transaction id. Useful for debugging. Corresponds to the
            OpenTelemetry trace ID.
    PermissionGroup:
      type: object
      properties:
        label:
          type: string
          description: The label of the permission group
          example: AI agent permisions
        description:
          type: string
          description: The description of the permission group
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
    Permission:
      type: object
      properties:
        name:
          type: string
          description: The name of the permission
          example: createAiAgent
        label:
          type: string
          description: The label of the permission
          example: Create AI agent
        value:
          type: boolean
          description: Whether the permission is granted
          example: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT-based authentication
      x-scopes:
        api: Full access to the API
    cookieAuth:
      type: apiKey
      in: cookie
      name: connect.sid
      description: Cookie-based authentication
      x-scopes:
        api: Full access to the API

````