---
title: "Create a training"
method: POST
path: "/training"
---

# Create a training

`POST /training`

Create a new training scenario. Use type "BEHAVIORAL" for always-active instructions (tone, guardrails) or "SCENARIO_SPECIFIC" (default) for question-triggered scenarios.

## Request body

- CreateTrainingPublicDto
  - `title` string, required — The scenario title or trigger phrase
  - `content` string, required — The instruction body — how the AI should respond
  - `type` 'BEHAVIORAL' | 'SCENARIO_SPECIFIC' — BEHAVIORAL (always active) or SCENARIO_SPECIFIC (semantic match, default)
  - `is_draft` boolean — If true, saved as draft and not used by the AI
  - `directory_id` string, nullable — Directory ID to organize into
  - `restricted_to_channels` SessionChannel[] — Limit to specific channels (empty = all)
  - `restricted_to_segments` string[] — Limit to specific segments (empty = all)
  - `metadata` object — Arbitrary key-value metadata for external integrations
  - `start_time` string, date-time, nullable — ISO 8601 instant (UTC) when the AI may start using this instruction. Null clears the start bound.
  - `end_time` string, date-time, nullable — ISO 8601 instant (UTC) when the AI stops using this instruction. Null clears the end bound.

## Response `201`

Default Response

- TrainingPublicResponseDto
  - `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/versions/57b06b52302d/schema)
