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

# Export training snapshots as a JSON download

> Returns a JSON file as an attachment. Response sets `Content-Disposition: attachment; filename="training-data-<ts>.json"`. The body is the export payload (not the `{ success, data }` envelope used elsewhere).



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/training/export
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/training/export:
    get:
      tags:
        - Training
      summary: Export training snapshots as a JSON download
      description: >-
        Returns a JSON file as an attachment. Response sets
        `Content-Disposition: attachment; filename="training-data-<ts>.json"`.
        The body is the export payload (not the `{ success, data }` envelope
        used elsewhere).
      operationId: get_training_export
      parameters:
        - in: query
          name: quality
          required: false
          schema:
            type: string
        - in: query
          name: category
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Training data exported as a JSON file attachment.
          headers:
            Content-Disposition:
              description: Always `attachment; filename="training-data-<timestamp>.json"`.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingExportPayload'
        '500':
          description: Failed to export training snapshots
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    TrainingExportPayload:
      type: object
      description: >-
        Top-level JSON body downloaded by /api/training/export. Not wrapped in a
        `{ success, data }` envelope.
      properties:
        exportDate:
          type: string
          format: date-time
        organizationId:
          type: string
        totalSnapshots:
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/TrainingExportItem'
      required:
        - exportDate
        - organizationId
        - totalSnapshots
        - data
      additionalProperties: true
      example:
        exportDate: '2026-05-18T14:30:00.000Z'
        organizationId: 65a0e0e0e0e0e0e0e0e0e0e0
        totalSnapshots: 1
        data:
          - id: 67f1a0b0c0d0e0f0a0b0c0d0
            customer:
              name: Jane Doe
              phone: '+14155550123'
              email: jane@example.com
            conversation:
              - role: assistant
                content: Hi! How can we help?
                timestamp: '2026-05-18T13:30:00.000Z'
                senderType: AI
            metadata:
              quality: good
              tags:
                - sales
              messageCount: 4
    TrainingErrorResponse:
      type: object
      description: >-
        Error envelope used by training endpoints. 500 responses additionally
        include the underlying `error` message.
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        error:
          type: string
      additionalProperties: true
      example:
        success: false
        message: Training snapshot not found
        error: NOT_FOUND
    TrainingExportItem:
      type: object
      properties:
        id:
          type: string
        customer:
          type: object
          properties:
            name:
              type: string
            phone:
              type: string
            email:
              type: string
              nullable: true
          additionalProperties: true
        conversation:
          type: array
          items:
            $ref: '#/components/schemas/TrainingExportConversationTurn'
        metadata:
          type: object
          properties:
            quality:
              type: string
            category:
              type: string
              nullable: true
            tags:
              type: array
              items:
                type: string
            notes:
              type: string
            messageCount:
              type: integer
            dateRange:
              type: object
              properties:
                start:
                  type: string
                  format: date-time
                end:
                  type: string
                  format: date-time
              additionalProperties: true
          additionalProperties: true
      additionalProperties: true
      example:
        id: 67f1a0b0c0d0e0f0a0b0c0d0
        customer:
          name: Jane Doe
          phone: '+14155550123'
          email: jane@example.com
        conversation:
          - role: assistant
            content: Hi! How can we help?
            timestamp: '2026-05-18T13:30:00.000Z'
            senderType: AI
          - role: user
            content: I need help with pricing.
            timestamp: '2026-05-18T13:31:00.000Z'
            senderType: HUMAN
        metadata:
          quality: good
          category: objection-handling
          tags:
            - sales
            - pricing
          notes: Great handling of objection on pricing.
          messageCount: 4
          dateRange:
            start: '2026-05-18T13:30:00.000Z'
            end: '2026-05-18T14:10:00.000Z'
    TrainingExportConversationTurn:
      type: object
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
        content:
          type: string
        timestamp:
          type: string
          format: date-time
        senderType:
          type: string
      additionalProperties: true
      example:
        role: assistant
        content: Hi! How can we help?
        timestamp: '2026-05-18T13:30:00.000Z'
        senderType: AI
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````