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

# Get all users

> This endpoint retrieves all users (paginated), newest first.

Results are paginated. For example, `GET /papi/users?page=2` returns the second page.




## OpenAPI

````yaml /openapi.yaml get /users
openapi: 3.1.0
info:
  title: Tribal Habits Public API
  version: '1'
  description: >
    The Tribal Habits Public API V1. Use it to manage your Tribal Habits user
    accounts (list, show, create and update) and other entities.


    Replace `myorg` in the server URL with your organisation's subdomain. See
    [Vanity URL](/vanity-url) if you use your own domain.
servers:
  - url: https://myorg.tribalhabits.com/papi
security:
  - ApiKeyHeader: []
tags:
  - name: Users
    description: Users
  - name: Topics
    description: Topics
  - name: Pathways
    description: Pathways
  - name: Enrolments
    description: Topic and Pathway Enrolments
  - name: Certificates
    description: >-
      Certificate generation and retrieval for completed topic and pathway
      enrolments.
  - name: External Knowledge
    description: Knowledge obtained from a source external of Tribal Habits.
  - name: Webhooks
    description: >-
      Webhooks triggered from certain actions in code that will call URLs
      assigned by you.
paths:
  /users:
    get:
      tags:
        - Users
      summary: Get all users
      description: >
        This endpoint retrieves all users (paginated), newest first.


        Results are paginated. For example, `GET /papi/users?page=2` returns the
        second page.
      operationId: getUsers
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/MaxPerPage'
        - name: updated_at
          in: query
          description: >-
            Only users updated after this time, in UTC. Use the ISO 8601 form
            "yyyy-mm-ddThh:mm:ss", eg "2023-02-01T15:12:13". Do not include a
            time zone offset
          schema:
            type: string
            example: '2023-02-01T15:12:13'
        - name: updated_before
          in: query
          description: >-
            Only users updated before this time, in UTC. Same form as
            `updated_at`, eg "2023-02-01T15:12:13"
          schema:
            type: string
            example: '2023-02-01T15:12:13'
        - name: active
          in: query
          description: >-
            If empty will show all users. `true`, `1` or `yes` returns only
            active users. `false`, `0` or `no` returns only inactive users.
            Values are case-insensitive. Any other value returns `400`.
          schema:
            type: string
        - name: email
          in: query
          description: >-
            Filter by exact email address (case-insensitive), eg
            "john@myorg.com"
          schema:
            type: string
        - name: x-[custom field name]
          in: query
          description: >
            Filter by Custom Field value. Replace `[custom field name]` with the
            name of the custom field, eg `x-city=Brisbane`.


            Custom Fields can be any of the following types; String, Number,
            Date or List. A String matches partially: for example, 'hello', 'he'
            and 'lo' all match a custom field with the value 'hello'. Numbers
            and Dates match by exact value so 23, would match 23 but not 233,
            and a Date matches given a format of 'YYYY-MM-DD' ex. '2025-03-20'.
            Custom Field of type List can also be filtered when given a comma
            separated list as the value, ex. x-city=Brisbane,Sydney would match
            all city custom fields with either 'Brisbane' or 'Sydney'. Each List
            value is a partial match on the list item name, so 'Syd' matches
            'Sydney'. The values and custom field names are case insensitive.
            Unknown custom field names are ignored.
          schema:
            type: string
      responses:
        '200':
          description: A page of users
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Pagination'
                  - type: object
                    properties:
                      records:
                        type: array
                        items:
                          $ref: '#/components/schemas/User'
              examples:
                example:
                  $ref: '#/components/examples/UserPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    Page:
      name: page
      in: query
      description: Results page to return
      schema:
        type: integer
        default: 1
    MaxPerPage:
      name: max_per_page
      in: query
      description: >-
        Maximum number of results per page. Maximum permitted page size is 100.
        Larger values are reduced to 100.
      schema:
        type: integer
        default: 25
  schemas:
    Pagination:
      type: object
      properties:
        total_records:
          type: integer
          description: Total number of records
        max_per_page:
          type: integer
          description: Maximum number of results per page
        current_page:
          type: integer
          description: Results page returned
        total_pages:
          type: integer
          description: Total number of pages
    User:
      type: object
      description: >-
        The user object returned by the user endpoints. Custom fields are
        included as `X-` fields, see [Custom fields](/custom-fields).
      properties:
        user_name:
          type: string
          description: >-
            Unique identifier of the user. Always stored and returned in lower
            case
        first_name:
          type: string
          description: User's first name
        last_name:
          type: string
          description: User's last name
        email:
          type: string
          description: User's email address
        manager_email:
          type:
            - string
            - 'null'
          description: Email address of the user's manager. `null` if not set
        manager_2_email:
          type:
            - string
            - 'null'
          description: Email address of the user's 2nd manager. `null` if not set
        manager_3_email:
          type:
            - string
            - 'null'
          description: Email address of the user's 3rd manager. `null` if not set
        manager_4_email:
          type:
            - string
            - 'null'
          description: Email address of the user's 4th manager. `null` if not set
        manager_5_email:
          type:
            - string
            - 'null'
          description: Email address of the user's 5th manager. `null` if not set
        mentor_email:
          type: string
          description: Email address of the user's mentor
        lms_learner_id:
          type: string
          description: User's identifier in your company LMS
        lms_reference:
          type: string
          description: User's LMS name in your company LMS
        org_admin:
          type: boolean
          description: '`true` if the user is an administrator'
        creator:
          type: boolean
          description: '`true` if the user can create topics'
        team_leader:
          type: boolean
          description: >-
            `true` if the user is the manager of at least one other user
            (derived from other users' manager emails)
        created_at:
          type: string
          format: date-time
          description: Timestamp
        updated_at:
          type: string
          format: date-time
          description: Timestamp
        current_sign_in_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Timestamp. `null` if the user has never signed in
        admin_type:
          type:
            - integer
            - 'null'
          description: >-
            Administrator type as a number: 0 = super, 1 = standard, 2 =
            knowledge, 3 = reporting, 4 = instructor, 5 = restricted, 6 =
            observer, 7 = people, 8 = library. `null` if not an administrator
        deactivate_scheduled_date:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Timestamp of the date on which the account is scheduled to be
            deactivated, or `null`
        reactivate_scheduled_date:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Timestamp of the date on which the account is scheduled to be
            reactivated, or `null`
        language:
          type: string
          description: Language code, eg `en`
        created_by:
          type: string
          description: How the user was created, eg `API`
        timezone:
          type: string
          description: User's time zone, eg `Australia/Sydney`
        user_notifications_enabled:
          type: boolean
          description: '`true` if the user receives email notifications'
        team_leader_report_frequency:
          type:
            - string
            - 'null'
          description: >-
            Team leader report email frequency. See [Update a specific
            user](/api-reference/users/update-a-specific-user) for values
        learner_report_frequency:
          type:
            - string
            - 'null'
          description: >-
            Learner report email frequency. See [Update a specific
            user](/api-reference/users/update-a-specific-user) for values
        assessor_report_frequency:
          type:
            - string
            - 'null'
          description: >-
            Assessor report email frequency. See [Update a specific
            user](/api-reference/users/update-a-specific-user) for values
        default_landing_page:
          type: string
          description: Page shown after login, or `Default`
        org_admin_access:
          type: string
          description: Name of the administrator type (see `admin_type`), or `none`
        login:
          type: string
          enum:
            - internal
            - external
          description: '`internal` or `external`'
        type:
          type: string
          description: Type of user, eg `Staff`, `Client`
        active:
          type: boolean
          description: '`false` if the account has been deactivated'
        X-[Custom]:
          description: Custom fields. See [Custom fields](/custom-fields)
        platform_champion:
          type: boolean
          description: '`true` if the user is a platform champion for your organisation'
        role_1:
          type:
            - string
            - 'null'
          description: Name of the role in position 1, or `null`
        role_2:
          type:
            - string
            - 'null'
          description: Name of the role in position 2, or `null`
        role_3:
          type:
            - string
            - 'null'
          description: Name of the role in position 3, or `null`
        role_4:
          type:
            - string
            - 'null'
          description: Name of the role in position 4, or `null`
        role_5:
          type:
            - string
            - 'null'
          description: Name of the role in position 5, or `null`
        groups:
          type: string
          description: Group names, sorted and separated by semicolons
        goals:
          type: string
          description: Goal names, sorted and separated by semicolons
      patternProperties:
        ^X-:
          description: Custom field. See [Custom fields](/custom-fields)
  examples:
    UserPage:
      summary: A page of users
      value:
        total_records: 47
        max_per_page: 25
        current_page: 1
        total_pages: 2
        records:
          - user_name: '12345'
            first_name: Bilbo
            last_name: Baggins
            email: bilbo@myorg.com
            manager_email: manager@company.com
            manager_2_email: manager2@company.com
            manager_3_email: null
            manager_4_email: null
            manager_5_email: null
            mentor_email: mentor@company.com
            lms_learner_id: '456'
            lms_reference: Testlms
            org_admin: false
            creator: false
            team_leader: false
            created_at: '2019-04-01T15:46:31.586+11:00'
            updated_at: '2021-06-15T09:25:25.756+10:00'
            current_sign_in_at: '2022-06-15T09:25:25.756+10:00'
            admin_type: null
            deactivate_scheduled_date: '2022-06-15T00:00:00.000+10:00'
            reactivate_scheduled_date: null
            language: en
            created_by: API
            timezone: Australia/Sydney
            user_notifications_enabled: true
            team_leader_report_frequency: every_thursday
            learner_report_frequency: null
            assessor_report_frequency: every_wednesday
            default_landing_page: Default
            org_admin_access: none
            login: internal
            type: Client
            active: true
            X-Country: Australia
            X-State: Queensland
            X-Preferred Name: Jack
            platform_champion: false
            role_1: Instructor
            role_2: null
            role_3: null
            role_4: null
            role_5: null
            groups: Brisbane;Bundaberg
            goals: Goal1;Goal2
  responses:
    BadRequest:
      description: >-
        Bad Request - The request is missing a required parameter or has an
        invalid value. See the response body for more details
      content:
        application/json:
          schema:
            type: string
          example: 'Bad request: Illegal value ''maybe'' for ''active'''
    Unauthorized:
      description: >-
        Unauthorized - The request does not include the API key, the API key is
        incorrect, or API access is not enabled on your plan.
    TooManyRequests:
      description: >-
        Too Many Requests - You have exceeded the rate limit. See [Rate
        limits](/rate-limits)
      headers:
        Retry-After:
          description: Number of seconds until the rate limit window resets
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
              retry_after_seconds:
                type: integer
          example:
            error: Rate limit exceeded. Please slow down.
            retry_after_seconds: 23
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: Authorization
      description: >
        Your organisation's API key, sent as `Authorization: my_api_key`. The
        key can also be passed as an `api_key` query parameter. See
        [Authentication](/authentication).

````

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