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

# List users

> Lists non-staff users with an active membership in the API key's company, ordered by `-created, last_login` by default. Supports free-text search, date-range filters and ordering.



## OpenAPI

````yaml /openapi.yaml get /clients/users/
openapi: 3.1.0
info:
  title: hackU Client API
  version: 1.2.0
  description: >
    Public API for hackU corporate clients. It lets a company manage its
    learners

    (create, update, deactivate), enroll them in courses (routes) and pensums,

    read their progress, and send WhatsApp / email communications.


    **Authentication.** Every request must send the header

    `Authorization: Api-Key <token>`. The key identifies the company; there is
    no

    company parameter in the URL except where noted.


    **Pagination.** List endpoints that are paginated use limit/offset

    (`limit` default 50, maximum 500) and return `{count, next, previous,
    results}`.


    **Errors.** A missing, invalid, revoked or expired key returns `403` with

    `{"detail": "..."}`. Validation errors return `400` with

    `{"<field>": ["<message>", ...]}` (or `non_field_errors`). Some messages are

    returned in Spanish.


    **Identifiers.** `user_id` in every path is the hackU user id, returned as

    `user_pk` by `POST /clients/users/` and as `id` by `GET /clients/users/`.
servers:
  - url: https://app.reinvented.education/api
    description: Production
  - url: https://qa-admin.hacku.co/api
    description: Test
security:
  - ApiKeyAuth: []
tags:
  - name: Users
    description: Create, read, update and deactivate the company's learners.
  - name: Enrollment
    description: Assign courses (routes), modules and pensums.
  - name: Progress
    description: >-
      Read learners' progress in courses, modules, pensums, evaluations, surveys
      and certificates.
  - name: Catalog
    description: The company's courses (routes) and their modules.
  - name: Extra fields
    description: Company-defined custom user fields.
  - name: Communications
    description: Send WhatsApp or email messages using approved templates.
paths:
  /clients/users/:
    get:
      tags:
        - Users
      summary: List users
      description: >-
        Lists non-staff users with an active membership in the API key's
        company, ordered by `-created, last_login` by default. Supports
        free-text search, date-range filters and ordering.
      operationId: listUsers
      parameters:
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Offset'
        - name: search
          in: query
          description: >-
            Case-insensitive partial match on username, first_name, last_name,
            phone_number or profile document_number.
          schema:
            type: string
          example: perez
        - name: ordering
          in: query
          description: >-
            Comma-separated field names; prefix with `-` for descending. Usable
            fields include `id`, `username`, `first_name`, `last_name`, `email`,
            `phone_number`, `is_client`, `is_verified`, `created`, `last_login`,
            `last_activity`, `offline_mode`.
          schema:
            type: string
          example: '-last_activity'
        - name: created_gte
          in: query
          description: Users created at or after this ISO 8601 datetime.
          schema:
            type: string
            format: date-time
          example: '2026-01-01T00:00:00-05:00'
        - name: created_lte
          in: query
          description: Users created at or before this ISO 8601 datetime.
          schema:
            type: string
            format: date-time
        - name: last_login_gte
          in: query
          description: Users whose last login is at or after this ISO 8601 datetime.
          schema:
            type: string
            format: date-time
        - name: last_login_lte
          in: query
          description: Users whose last login is at or before this ISO 8601 datetime.
          schema:
            type: string
            format: date-time
        - name: last_activity_gte
          in: query
          description: Users whose last activity is at or after this ISO 8601 datetime.
          schema:
            type: string
            format: date-time
        - name: last_activity_lte
          in: query
          description: Users whose last activity is at or before this ISO 8601 datetime.
          schema:
            type: string
            format: date-time
        - name: or_filter
          in: query
          description: >
            When `true`, the date filters are combined with OR across the three
            field

            groups (created, last_login, last_activity) instead of AND. Bounds
            within the

            same group are still combined with AND, and rows where that field is
            null

            never match. In this mode the exact-match parameters `created`,
            `last_login`

            and `last_activity` are also accepted.
          schema:
            type: boolean
            default: false
        - name: course_finished_date
          in: query
          description: >-
            Only users who finished one of the company's courses on this date
            (`YYYY-MM-DD`). An invalid date is ignored.
          schema:
            type: string
            format: date
          example: '2026-11-20'
      responses:
        '200':
          description: Paginated users.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedUsers'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    Limit:
      name: limit
      in: query
      description: Page size (default 50, maximum 500).
      schema:
        type: integer
        minimum: 1
        maximum: 500
        default: 50
    Offset:
      name: offset
      in: query
      description: Number of items to skip.
      schema:
        type: integer
        minimum: 0
        default: 0
  schemas:
    PaginatedUsers:
      allOf:
        - $ref: '#/components/schemas/PaginationMeta'
        - type: object
          properties:
            results:
              type: array
              items:
                $ref: '#/components/schemas/ClientUser'
    PaginationMeta:
      type: object
      required:
        - count
        - next
        - previous
      properties:
        count:
          type: integer
          description: Total number of items.
        next:
          type:
            - string
            - 'null'
          format: uri
        previous:
          type:
            - string
            - 'null'
          format: uri
    ClientUser:
      type: object
      properties:
        id:
          type: integer
        username:
          type: string
        is_client:
          type: boolean
          description: Has an active membership.
        is_verified:
          type: boolean
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
          format: email
        phone_number:
          type:
            - string
            - 'null'
        user_company:
          type:
            - string
            - 'null'
          description: Slug of the API key's company if the membership is active.
        profile:
          $ref: '#/components/schemas/UserProfileSummary'
        active_module:
          type: array
          description: Active modules in the company's courses.
          items:
            $ref: '#/components/schemas/ActiveModule'
        user_extra_field:
          type: array
          items:
            $ref: '#/components/schemas/UserExtraFieldValue'
        last_activity:
          type:
            - string
            - 'null'
          format: date-time
        created:
          type: string
          format: date-time
        last_login:
          type:
            - string
            - 'null'
          format: date-time
        offline_mode:
          type: boolean
        membership_start_date:
          type:
            - string
            - 'null'
          format: date
          description: From the user's most recent membership.
        membership_expiration:
          type:
            - string
            - 'null'
          format: date
          description: From the user's most recent membership.
      example:
        id: 48213
        username: ana.perez@example.com
        is_client: true
        is_verified: true
        first_name: Ana
        last_name: Pérez
        email: ana.perez@example.com
        phone_number: '+573001112233'
        user_company: acme
        profile:
          document_type: CEDULA
          document_number: '1000000001'
          hour: '08:30:00'
          points: 120
        active_module: []
        user_extra_field:
          - extra_field_company: area
            extra_field_choice: ventas
            value: null
            json_data: null
        last_activity: '2026-11-24T09:12:40-05:00'
        created: '2026-10-01T14:00:00-05:00'
        last_login: null
        offline_mode: false
        membership_start_date: '2026-10-01'
        membership_expiration: '2027-10-01'
    Error:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
    UserProfileSummary:
      type: object
      properties:
        document_type:
          oneOf:
            - $ref: '#/components/schemas/DocumentType'
            - type: 'null'
        document_number:
          type:
            - string
            - 'null'
        hour:
          type: string
          description: Delivery time, HH:MM:SS.
          example: '08:30:00'
        points:
          type: integer
    ActiveModule:
      type: object
      properties:
        route:
          $ref: '#/components/schemas/Route'
        content_module:
          $ref: '#/components/schemas/Module'
        is_active:
          type: boolean
        progress_percentage:
          type: integer
        extra_data:
          type:
            - object
            - 'null'
    UserExtraFieldValue:
      type: object
      properties:
        extra_field_company:
          type: string
          description: The extra field's `name`.
        extra_field_choice:
          type:
            - string
            - 'null'
          description: Selected choice's `name` for SELECT fields.
        value:
          type:
            - string
            - 'null'
        json_data:
          type:
            - object
            - 'null'
    DocumentType:
      type: string
      enum:
        - CEDULA
        - INE
        - TI
        - DNI
        - CEDULA_EX
        - PASS
        - PERMISO
        - SALVOC
        - EXPEDIENTE
        - CPF
        - RUT
      description: >-
        CEDULA: national id; INE; TI: identity card (minors); DNI; CEDULA_EX:
        foreigner id; PASS: passport; PERMISO: special permit; SALVOC:
        safe-conduct; EXPEDIENTE; CPF; RUT.
    Route:
      type: object
      description: A course.
      properties:
        id:
          type: integer
        external_id:
          type:
            - string
            - 'null'
          description: Your own identifier for the course.
        name:
          type: string
        slug_name:
          type: string
        total_contents:
          type: integer
        minutes_duration:
          type: integer
        starting_date:
          type:
            - string
            - 'null'
          format: date
        rating:
          type: number
        language:
          $ref: '#/components/schemas/Language'
        finished:
          type: boolean
          description: The course content is complete.
        published:
          type: boolean
        automatic_advance:
          type: boolean
        alias:
          type:
            - string
            - 'null'
        test_trials_available:
          type:
            - integer
            - 'null'
          description: >-
            Evaluation attempts allowed; null or 0 means the company-wide value
            applies.
    Module:
      type: object
      properties:
        pk:
          type: integer
        slug_name:
          type: string
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        minutes_duration:
          type: integer
        total_contents:
          type: integer
        alias:
          type:
            - string
            - 'null'
          description: Alternative identifier for integrations.
    Language:
      type: string
      enum:
        - es
        - en
        - pt
  responses:
    Forbidden:
      description: Missing, invalid, revoked or expired API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            detail: Authentication credentials were not provided.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Company API key. The header value must be `Api-Key <token>`, e.g.
        `Authorization: Api-Key AbCd1234.xxxxxxxx`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.