> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open.cx/llms.txt
> Use this file to discover all available pages before exploring further.

> Get a single training by ID. Use when pushing training scenarios or knowledge into the AI training index from an external pipeline.

# Get a training



## OpenAPI

````yaml get /training/{id}
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /training/{id}:
    get:
      summary: Get a training
      description: Get a single training by ID.
      operationId: getTraining
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingPublicResponseDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    TrainingPublicResponseDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/TrainingPublicResponseDto'
      type: object
      properties:
        id:
          type: string
          description: Unique training ID
        title:
          type: string
          description: The scenario title or trigger phrase (last published version)
        content:
          type: string
          description: >-
            The instruction body — how the AI should respond (last published
            version)
        draft_title:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Draft title being edited (null if no draft exists). Use draft_title
            ?? title.
        draft_content:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Draft body being edited (null if no draft exists). Use draft_content
            ?? content.
        type:
          type: string
          enum:
            - BEHAVIORAL
            - SCENARIO_SPECIFIC
          description: BEHAVIORAL (always active) or SCENARIO_SPECIFIC (semantic match)
        is_draft:
          type: boolean
          description: Draft trainings are saved but not used by the AI
        directory_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Directory this training belongs to
        restricted_to_channels:
          type: array
          items:
            $ref: '#/components/schemas/SessionChannel'
          description: Channels this applies to (empty = all)
        restricted_to_segments:
          type: array
          items:
            type: string
          description: Contact segments this applies to (empty = all)
        current_version:
          anyOf:
            - type: number
            - type: 'null'
          description: Active published version number (null if unpublished draft)
        metadata:
          anyOf:
            - type: object
              propertyNames:
                type: string
              additionalProperties: {}
            - type: 'null'
          description: Arbitrary key-value metadata for external integrations
        published_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: When the current version was published
        start_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Active window start (UTC). Null = no start bound.
        end_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Active window end (UTC). Null = no end bound.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - title
        - content
        - draft_title
        - draft_content
        - type
        - is_draft
        - directory_id
        - restricted_to_channels
        - restricted_to_segments
        - current_version
        - metadata
        - published_at
        - start_time
        - end_time
        - created_at
        - updated_at
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    SessionChannel:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/SessionChannel'
      type: string
      enum:
        - web
        - email
        - phone_voice
        - slack
        - sms
        - whatsapp
        - instagram
        - messenger
        - api
        - web_voice
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````