---
title: "Get directory tree"
method: GET
path: "/training/directories/tree"
---

# Get directory tree

`GET /training/directories/tree`

Get all directories with their trainings, plus uncategorized trainings. Useful for getting a full overview of how trainings are organized.

## Query parameters

- `show_drafts` 'true' | 'false'
- `show_published` 'true' | 'false'

## Response `200`

Default Response

- TrainingDirectoryTreePublicDto
  - `directories` DirectoryTreeItem[], required
    - `id` string, required
    - `name` string, required
    - `org_id` string, required
    - `items` TrainingPublicResponseDto[], required
      - `id` string, required — Unique training ID
      - `title` string, required — The scenario title or trigger phrase (last published version)
      - `content` string, required — The instruction body — how the AI should respond (last published version)
      - `draft_title` string, nullable, required — Draft title being edited (null if no draft exists). Use draft_title ?? title.
      - `draft_content` string, nullable, required — Draft body being edited (null if no draft exists). Use draft_content ?? content.
      - `type` 'BEHAVIORAL' | 'SCENARIO_SPECIFIC', required — BEHAVIORAL (always active) or SCENARIO_SPECIFIC (semantic match)
      - `is_draft` boolean, required — Draft trainings are saved but not used by the AI
      - `directory_id` string, nullable, required — Directory this training belongs to
      - `restricted_to_channels` SessionChannel[], required — Channels this applies to (empty = all)
      - `restricted_to_segments` string[], required — Contact segments this applies to (empty = all)
      - `current_version` number, nullable, required — Active published version number (null if unpublished draft)
      - `metadata` object, nullable, required — Arbitrary key-value metadata for external integrations
      - `published_at` string, date-time, nullable, required — When the current version was published
      - `start_time` string, date-time, nullable, required — Active window start (UTC). Null = no start bound.
      - `end_time` string, date-time, nullable, required — Active window end (UTC). Null = no end bound.
      - `created_at` string, date-time, required
      - `updated_at` string, date-time, required
  - `uncategorized` TrainingPublicResponseDto[], required
    - `id` string, required — Unique training ID
    - `title` string, required — The scenario title or trigger phrase (last published version)
    - `content` string, required — The instruction body — how the AI should respond (last published version)
    - `draft_title` string, nullable, required — Draft title being edited (null if no draft exists). Use draft_title ?? title.
    - `draft_content` string, nullable, required — Draft body being edited (null if no draft exists). Use draft_content ?? content.
    - `type` 'BEHAVIORAL' | 'SCENARIO_SPECIFIC', required — BEHAVIORAL (always active) or SCENARIO_SPECIFIC (semantic match)
    - `is_draft` boolean, required — Draft trainings are saved but not used by the AI
    - `directory_id` string, nullable, required — Directory this training belongs to
    - `restricted_to_channels` SessionChannel[], required — Channels this applies to (empty = all)
    - `restricted_to_segments` string[], required — Contact segments this applies to (empty = all)
    - `current_version` number, nullable, required — Active published version number (null if unpublished draft)
    - `metadata` object, nullable, required — Arbitrary key-value metadata for external integrations
    - `published_at` string, date-time, nullable, required — When the current version was published
    - `start_time` string, date-time, nullable, required — Active window start (UTC). Null = no start bound.
    - `end_time` string, date-time, nullable, required — Active window end (UTC). Null = no end bound.
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `500` — Internal Server Error

---

[API](https://skmtc.net/open/apis/opencx-api.md) · [All operations](https://skmtc.net/open/apis/opencx-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/open/opencx-api/revisions/57b06b52302d/schema)
