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

> List all trainings — List all training scenarios for your organization. Use when pushing training scenarios or knowledge into the AI training index from an external pipeline.

# List all trainings



## OpenAPI

````yaml get /training
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:
    get:
      summary: List all trainings
      description: >-
        List all training scenarios for your organization. Trainings teach the
        AI how to respond to specific situations. Supports filtering by search
        term, type, and draft status, with pagination.
      operationId: listTrainings
      parameters:
        - schema:
            type: string
          in: query
          name: search
          required: false
          description: Case-insensitive search on title or content
        - schema:
            type: string
            enum:
              - BEHAVIORAL
              - SCENARIO_SPECIFIC
          in: query
          name: type
          required: false
          description: 'Filter by type: BEHAVIORAL or SCENARIO_SPECIFIC'
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
          in: query
          name: is_draft
          required: false
          description: Filter by draft status
        - schema:
            default: 50
            type: integer
            minimum: 1
            maximum: 100
          in: query
          name: limit
          required: false
          description: Max items to return (1-100, default 50)
        - schema:
            default: 0
            type: integer
            minimum: 0
            maximum: 9007199254740991
          in: query
          name: offset
          required: false
          description: Number of items to skip (default 0)
        - schema:
            default: created_at
            type: string
            enum:
              - created_at
              - handoff_count
          in: query
          name: sort_by
          required: false
          description: >-
            Sort by field: created_at (default) or handoff_count (most handoffs
            first)
        - schema:
            type: string
          in: query
          name: metadata
          required: false
          description: >-
            Filter by metadata — JSON object of key-value pairs to match (uses
            jsonb @> containment)
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTrainingsOutput'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    ListTrainingsOutput:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/ListTrainingsOutput'
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/TrainingPublicResponseDto'
        total:
          type: number
          description: Total matching items before pagination
        limit:
          type: number
        offset:
          type: number
        has_more:
          type: boolean
          description: Whether more items exist beyond this page
      required:
        - items
        - total
        - limit
        - offset
        - has_more
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    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
    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

````