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

# Update role

> Update a realm role.



## OpenAPI

````yaml /openapi/user.yaml put /api/v1/auth/roles/{id}
openapi: 3.0.3
info:
  title: CapeMedia User Service API
  version: 1.0.0
  description: |2-

        **CapeMedia User Service API** - Comprehensive user service and management system.

        ## Authentication
        This API uses **JWT Bearer tokens** for authentication.

        1. Login via `/api/v1/auth/login` to obtain tokens
        2. Include the access token in the `Authorization` header: `Bearer <access_token>`
        3. Refresh expired tokens via `/api/v1/auth/refresh-token`

        ## Versioning
        The API uses URL path versioning (e.g., `/api/v1/`, `/api/v2/`).
        Current version: **v1**
        
  contact:
    name: API Support
    email: support@capemedia.co.ke
  license:
    name: Cape Media
servers:
  - url: https://api.diginacape.co.ke/acl
    description: Production
  - url: http://localhost:8000
    description: Local
security: []
paths:
  /api/v1/auth/roles/{id}:
    put:
      tags:
        - Roles
      summary: Update role
      description: Update a realm role.
      operationId: roles_update
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateListRoleRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateListRoleRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateListRoleRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateListRole'
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    CreateListRoleRequest:
      type: object
      description: Serializer for Keycloak role information.
      properties:
        name:
          type: string
          minLength: 1
          description: Role name (stored as snake_case)
        description:
          type: string
          default: ''
          description: Role description
        department_id:
          type: string
          format: uuid
          writeOnly: true
          description: Department ID
      required:
        - department_id
        - name
    CreateListRole:
      type: object
      description: Serializer for Keycloak role information.
      properties:
        name:
          type: string
          description: Role name (stored as snake_case)
        description:
          type: string
          default: ''
          description: Role description
        id:
          type: string
          readOnly: true
          description: Role ID (UUID)
      required:
        - id
        - name
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT token in the format: Bearer <token>'

````