> ## 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 a specific topic

> This endpoint retrieves a specific topic.

Returns `404` if the topic does not exist.




## OpenAPI

````yaml /openapi.yaml get /topics/{id}
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/{id}:
    get:
      tags:
        - Topics
      summary: Get a specific topic
      description: |
        This endpoint retrieves a specific topic.

        Returns `404` if the topic does not exist.
      operationId: getTopic
      parameters:
        - name: id
          in: path
          required: true
          description: The unique identifier of a topic
          schema:
            type: integer
          example: 16
      responses:
        '200':
          description: The topic
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Topic'
              examples:
                example:
                  $ref: '#/components/examples/Topic'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    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:
    Topic:
      summary: A topic
      value:
        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.
    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.