> ## 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 topic enrolments by user

> This endpoint retrieves all topic enrolments for a user (paginated), oldest first. `user_name` is case-insensitive. Returns `404` if the user does not exist.

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




## OpenAPI

````yaml /openapi.yaml get /topic_assignments/user/{user_name}
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:
  /topic_assignments/user/{user_name}:
    get:
      tags:
        - Enrolments
      summary: Get all topic enrolments by user
      description: >
        This endpoint retrieves all topic enrolments for a user (paginated),
        oldest first. `user_name` is case-insensitive. Returns `404` if the user
        does not exist.


        Results are paginated. For example, `GET
        /papi/topic_assignments/user/12345?page=2` returns the second page.
      operationId: getTopicEnrolmentsByUser
      parameters:
        - name: user_name
          in: path
          required: true
          description: The user's `user_name` (case-insensitive)
          schema:
            type: string
          example: '12345'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/MaxPerPage'
        - $ref: '#/components/parameters/UpdatedAt'
      responses:
        '200':
          description: A page of the user's topic enrolments
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Pagination'
                  - type: object
                    properties:
                      records:
                        type: array
                        items:
                          $ref: '#/components/schemas/TopicEnrolment'
              example:
                total_records: 371
                max_per_page: 25
                current_page: 1
                total_pages: 15
                records:
                  - id: 6
                    created_at: '2019-04-16T09:59:31.980+10:00'
                    completed_topic_at: '2020-07-02T16:26:25.554+10:00'
                    status: Conquered
                    due_date: '2019-04-30T23:59:59.999+10:00'
                    relationship: reader
                    conquered_minutes: 63
                    conquered_cpd_minutes: 123
                    enrolled_by: null
                    certified_date: null
                    recertification_allowed: true
                    updated_at: '2020-07-02T16:26:25.566+10:00'
                    version: null
                    skills_attained:
                      - id: 13
                        name: First Aid
                    categories:
                      - name: Health
                        minutes: 39.5
                        points: 500
                    person:
                      id: 2
                      name: User1
                      user_name: '12345'
                      link: /people/users/7
                    topic:
                      id: 3
                      title: Confident and effective business networking
                      link: /knowledge/topics/3/overview
                      knowledge_type: 0
                      show_certificate: true
                      external_id: '123'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '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
    UpdatedAt:
      name: updated_at
      in: query
      description: >-
        Only records 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'
  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
    TopicEnrolment:
      type: object
      properties:
        id:
          type: integer
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        completed_topic_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the topic was completed, or `null`
        status:
          type: string
          enum:
            - Pre-enrolled
            - Unexplored
            - Exploring
            - Applying
            - Conquered
          description: >-
            Progress of the enrolment: `Pre-enrolled`, `Unexplored`,
            `Exploring`, `Applying` or `Conquered` (completed)
        due_date:
          type:
            - string
            - 'null'
          format: date-time
        relationship:
          type: string
          enum:
            - reader
            - author
            - assessor
          description: '`reader` (explorer), `author` (creator) or `assessor`'
        conquered_minutes:
          type:
            - number
            - 'null'
          description: Minutes recorded on completion
        conquered_cpd_minutes:
          type:
            - number
            - 'null'
          description: Minutes recorded on completion
        enrolled_by:
          type:
            - string
            - 'null'
        certified_date:
          type:
            - string
            - 'null'
          description: Date the certification is valid until, or `null`
        recertification_allowed:
          type: boolean
        version:
          type:
            - string
            - 'null'
          description: Version of the topic completed, or `null`
        skills_attained:
          type: array
          items:
            $ref: '#/components/schemas/SkillAttained'
        categories:
          type: array
          description: Continuing education categories recorded on completion
          items:
            type: object
            properties:
              name:
                type: string
              minutes:
                type: number
              points:
                type: number
        person:
          $ref: '#/components/schemas/EnrolmentPerson'
        topic:
          type: object
          properties:
            id:
              type: integer
            title:
              type: string
            link:
              type: string
              description: Path of the related page in Tribal Habits
            knowledge_type:
              type: integer
              enum:
                - 0
                - 1
              description: '`0` = standard topic, `1` = short topic'
            show_certificate:
              type: boolean
            external_id:
              type:
                - string
                - 'null'
    SkillAttained:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
    EnrolmentPerson:
      type: object
      properties:
        id:
          type: integer
          description: Internal user ID. This is not the `user_name`
        name:
          type: string
        user_name:
          type: string
        link:
          type: string
          description: Path of the related page in Tribal Habits
  responses:
    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.
    NotFound:
      description: Not Found - The specified resource or endpoint could not be found
      content:
        application/json:
          schema:
            type: string
          example: not found
    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.