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

# Get user Keycloak events

> Get Keycloak events for a specific user (cursor-paginated).



## OpenAPI

````yaml /openapi/user.yaml get /api/v1/auth/users/{id}/events
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/users/{id}/events:
    get:
      tags:
        - Users
      summary: Get user Keycloak events
      description: Get Keycloak events for a specific user (cursor-paginated).
      operationId: users_events
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this User.
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListUsers'
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    ListUsers:
      type: object
      description: Serializer for listing users with department information.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        username:
          type: string
          pattern: ^[\w.@+-]+$
          maxLength: 150
        email:
          type: string
          format: email
          title: Email address
          maxLength: 254
        first_name:
          type: string
          maxLength: 150
        last_name:
          type: string
          maxLength: 150
        name:
          type: string
          readOnly: true
        phone_number:
          type: string
          maxLength: 50
        status:
          type: string
          maxLength: 20
        user_type:
          enum:
            - STAFF
            - CORRESPONDENT
            - CONSUMER
          type: string
          description: |-
            * `STAFF` - Staff
            * `CORRESPONDENT` - Correspondent
            * `CONSUMER` - Cape Digi Consumer
          x-spec-enum-id: a7ab5e3cba9d3868
        date_joined:
          type: string
          format: date-time
        last_login:
          type: string
          format: date-time
          nullable: true
        inactive_alert:
          type: boolean
          description: >-
            True if the user has not logged in for 2 or more business days
            (Mon–Fri).


            None last_login (never logged in) is also treated as inactive.
          readOnly: true
        department:
          type: string
          readOnly: true
        section:
          type: string
          readOnly: true
      required:
        - department
        - id
        - inactive_alert
        - name
        - section
        - username
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT token in the format: Bearer <token>'

````