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

> This endpoint retrieves all topics (paginated), ordered by title. Draft and archived topics are included; use `visibility` to tell them apart.

`knowledge_type` can be either 0 or 1. Where 0 = standard topic, 1 = short topic.

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




## OpenAPI

````yaml /openapi.yaml get /topics
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:
  /topics:
    get:
      tags:
        - Topics
      summary: Get all topics
      description: >
        This endpoint retrieves all topics (paginated), ordered by title. Draft
        and archived topics are included; use `visibility` to tell them apart.


        `knowledge_type` can be either 0 or 1. Where 0 = standard topic, 1 =
        short topic.


        Results are paginated. For example, `GET /papi/topics?page=2` returns
        the second page.
      operationId: getTopics
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/MaxPerPage'
        - name: knowledge_type
          in: query
          description: >-
            `0` returns only standard topics, `1` returns only short topics. If
            omitted, both are returned
          schema:
            type: integer
            enum:
              - 0
              - 1
        - $ref: '#/components/parameters/UpdatedAt'
      responses:
        '200':
          description: A page of topics
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Pagination'
                  - type: object
                    properties:
                      records:
                        type: array
                        items:
                          $ref: '#/components/schemas/Topic'
              examples:
                example:
                  $ref: '#/components/examples/TopicPage'
        '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
    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
    Topic:
      type: object
      properties:
        id:
          type: integer
        title:
          type: string
        knowledge_code:
          type: string
        structure:
          type: string
        assessment:
          type: boolean
        num_assessment_questions_to_ask:
          type: integer
        num_assessment_questions_to_pass:
          type: integer
        num_assessment_resets_permitted:
          type: integer
        duration_in_minutes:
          type: integer
        free:
          type: boolean
        restricted:
          type: boolean
        due_mode:
          type: string
          enum:
            - none
            - fixed_date
            - fixed_time
          description: >-
            `none`, `fixed_date` (due by `due_date`) or `fixed_time` (due
            `due_in_days` after enrolment)
        due_date:
          type:
            - string
            - 'null'
        due_in_days:
          type:
            - integer
            - 'null'
        visibility:
          type: string
          enum:
            - private
            - public
            - archived
          description: '`private` (draft), `public` (active) or `archived`'
        allow_public_signup:
          type: boolean
        show_accessibility_section_headers:
          type: boolean
        show_narration_scripts:
          type: boolean
        hide_system_oeq_responses:
          type: boolean
        knowledge_type:
          type: integer
          enum:
            - 0
            - 1
          description: '`0` = standard topic, `1` = short topic'
        manager_enrol:
          type: boolean
        manager_unenrol:
          type: boolean
        certified_mode:
          type: string
          enum:
            - none
            - fixed_date
            - fixed_time
          description: >-
            `none` (certificate always valid), `fixed_date` (valid until
            `certified_date`) or `fixed_time` (valid for `certified_days`)
        certified_days:
          type:
            - integer
            - 'null'
        certified_date:
          type:
            - string
            - 'null'
        show_certificate:
          type: boolean
        certificate_expire_event:
          type: integer
          description: >-
            When `certified_mode` is `fixed_time`: `0` = days counted from
            completion, `1` = days counted from enrolment
        recertify:
          type: boolean
        recertification_days:
          type: integer
        hide_results_until_admin_approval:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        completion_certificate_id:
          type:
            - integer
            - 'null'
        external_id:
          type:
            - string
            - 'null'
        categories:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              show_explorers:
                type: boolean
              time_allocation:
                type:
                  - number
                  - 'null'
              points_allocation:
                type:
                  - number
                  - 'null'
        topic_categories:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              category_id:
                type: integer
              time_allocation:
                type:
                  - number
                  - 'null'
              points_allocation:
                type:
                  - number
                  - 'null'
        skills:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              show_explorers:
                type: boolean
        links:
          type: object
          properties:
            standard:
              type: string
            internal_enrol:
              type: string
            enrol_links:
              type: array
              description: >-
                Internal (`link_type` 0) and LMS (`link_type` 2) auto-enrol
                links. External auto-enrol links are not returned. `entity_type`
                is `0` for topics and `1` for pathways
              items:
                $ref: '#/components/schemas/EnrolLink'
        saved_searches:
          type: array
          items:
            $ref: '#/components/schemas/SavedSearch'
        version:
          type: object
          description: >-
            Current published version. Omitted if the topic has never been
            published
          properties:
            major:
              type: integer
            minor:
              type: integer
            created_at:
              type: string
              format: date-time
        code:
          type: string
          description: Enrolment code for this topic, used in enrolment requests
        scorm_file_count:
          type: integer
    EnrolLink:
      type: object
      properties:
        id:
          type: integer
        entity_type:
          type: integer
          description: '`0` for topics and `1` for pathways'
        link_type:
          type: integer
          description: '`0` = internal, `2` = LMS'
        url:
          type: string
        reference:
          type: string
        active:
          type: boolean
        enrolments_count:
          type: integer
        enrolment_limit:
          type: integer
        user_type:
          type:
            - string
            - 'null'
        expires:
          type:
            - string
            - 'null'
    SavedSearch:
      type: object
      properties:
        id:
          type: integer
        q:
          type: array
          items:
            type: object
            properties:
              op:
                type: string
              attr:
                type: string
              name:
                type: string
              values:
                type: array
                items:
                  type: string
              description:
                type: string
  examples:
    TopicPage:
      summary: A page of topics
      value:
        total_records: 47
        max_per_page: 25
        current_page: 1
        total_pages: 2
        records:
          - id: 16
            title: A topic title
            knowledge_code: SALES-101
            structure: parts
            assessment: true
            num_assessment_questions_to_ask: 3
            num_assessment_questions_to_pass: 1
            num_assessment_resets_permitted: 3
            duration_in_minutes: 12
            free: false
            restricted: false
            due_mode: none
            due_date: null
            due_in_days: null
            visibility: public
            allow_public_signup: false
            show_accessibility_section_headers: false
            show_narration_scripts: false
            hide_system_oeq_responses: false
            knowledge_type: 0
            manager_enrol: false
            manager_unenrol: false
            certified_mode: none
            certified_days: null
            certified_date: null
            show_certificate: true
            certificate_expire_event: 0
            recertify: false
            recertification_days: 0
            hide_results_until_admin_approval: false
            created_at: '2019-07-01T15:22:05.752+10:00'
            updated_at: '2020-01-22T14:38:39.099+11:00'
            completion_certificate_id: null
            external_id: '123'
            categories:
              - id: 1
                name: Sales
                show_explorers: true
                time_allocation: null
                points_allocation: null
            topic_categories:
              - id: 34
                category_id: 6
                time_allocation: 70
                points_allocation: 0
            skills:
              - id: 13
                name: First Aid
                show_explorers: true
            links:
              standard: https://myorg.tribalhabits.com/topics/16/explore
              internal_enrol: >-
                https://myorg.tribalhabits.com/internals/437fafd440cdde8a4cb13955217f96ac
              enrol_links:
                - id: 35
                  entity_type: 0
                  link_type: 0
                  url: >-
                    https://myorg.tribalhabits.com/internals/437fafd440cdde8a4cb13955217f96ac
                  reference: testInt
                  active: true
                  enrolments_count: 0
                  enrolment_limit: 0
                  user_type: null
                  expires: null
            saved_searches:
              - id: 47
                q:
                  - op: in
                    attr: category
                    name: Type
                    values:
                      - staff
                    description: ' Type is Staff'
            version:
              major: 1
              minor: 0
              created_at: '2019-07-01T15:23:56.815+10:00'
            code: TH-4-16
            scorm_file_count: 0
  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.
    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.