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

# Create a training snapshot from a conversation

> Capture a contact's conversation (optionally filtered to specific `messageIds`) as a training snapshot for downstream fine-tuning. Notes/tags/quality/category are persisted with the snapshot.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/training/snapshots
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/snapshots:
    post:
      tags:
        - Training
      summary: Create a training snapshot from a conversation
      description: >-
        Capture a contact's conversation (optionally filtered to specific
        `messageIds`) as a training snapshot for downstream fine-tuning.
        Notes/tags/quality/category are persisted with the snapshot.
      operationId: post_training_snapshots
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrainingSnapshotCreateRequest'
      responses:
        '201':
          description: Training snapshot created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingSnapshotMutationResponse'
        '400':
          description: No messages found for this contact
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingErrorResponse'
        '404':
          description: Contact not found or access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    TrainingSnapshotCreateRequest:
      type: object
      properties:
        contactId:
          type: string
        messageIds:
          type: array
          items:
            type: string
        notes:
          type: string
        tags:
          type: array
          items:
            type: string
        quality:
          type: string
          description: Quality rating, e.g. "good", "bad", "neutral"
        category:
          type: string
      required:
        - contactId
      additionalProperties: true
      example:
        contactId: 65c2d0e0f0a0b0c0d0e0f0a0
        messageIds:
          - 67e0a0b0c0d0e0f0a0b0c0d0
          - 67e0a0b0c0d0e0f0a0b0c0d1
        notes: Great handling of objection on pricing.
        tags:
          - sales
          - pricing
        quality: good
        category: objection-handling
    TrainingSnapshotMutationResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        message:
          type: string
        data:
          $ref: '#/components/schemas/TrainingSnapshotItem'
      required:
        - success
        - data
      additionalProperties: true
      example:
        success: true
        message: Training snapshot created successfully
        data:
          _id: 67f1a0b0c0d0e0f0a0b0c0d0
          organizationId: 65a0e0e0e0e0e0e0e0e0e0e0
          customerName: Jane Doe
          quality: good
          tags:
            - sales
            - pricing
          isArchived: false
          createdAt: '2026-05-18T14:30:00.000Z'
          updatedAt: '2026-05-18T14:30:00.000Z'
    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
    TrainingSnapshotItem:
      type: object
      description: >-
        Mongoose `TrainingSnapshot` document. `userId` and `contactId` are
        populated to user/contact docs on read endpoints.
      properties:
        _id:
          type: string
        organizationId:
          type: string
        userId:
          oneOf:
            - type: string
            - type: object
              properties:
                _id:
                  type: string
                firstName:
                  type: string
                lastName:
                  type: string
                email:
                  type: string
              additionalProperties: true
        contactId:
          oneOf:
            - type: string
            - type: object
              properties:
                _id:
                  type: string
                firstName:
                  type: string
                lastName:
                  type: string
                phoneNumber:
                  type: string
                email:
                  type: string
                channelType:
                  type: string
              additionalProperties: true
        customerName:
          type: string
        customerPhone:
          type: string
        customerEmail:
          type: string
          nullable: true
        messages:
          type: array
          items:
            $ref: '#/components/schemas/TrainingSnapshotMessage'
        messageCount:
          type: integer
        snapshotDate:
          type: string
          format: date-time
        conversationStartDate:
          type: string
          format: date-time
        conversationEndDate:
          type: string
          format: date-time
        notes:
          type: string
        tags:
          type: array
          items:
            type: string
        quality:
          type: string
        category:
          type: string
          nullable: true
        isArchived:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: true
      example:
        _id: 67f1a0b0c0d0e0f0a0b0c0d0
        organizationId: 65a0e0e0e0e0e0e0e0e0e0e0
        userId:
          _id: 65b1f0a2c3d4e5f6a7b8c9d0
          firstName: Alice
          lastName: Rivera
          email: alice@example.com
        contactId:
          _id: 65c2d0e0f0a0b0c0d0e0f0a0
          firstName: Jane
          lastName: Doe
          phoneNumber: '+14155550123'
          email: jane@example.com
          channelType: sms
        customerName: Jane Doe
        customerPhone: '+14155550123'
        customerEmail: jane@example.com
        messages:
          - id: 67e0a0b0c0d0e0f0a0b0c0d0
            content: Hi! How can we help?
            sender: user
            senderType: AI
            timestamp: '2026-05-18T13:30:00.000Z'
        messageCount: 4
        snapshotDate: '2026-05-18T14:30:00.000Z'
        conversationStartDate: '2026-05-18T13:30:00.000Z'
        conversationEndDate: '2026-05-18T14:10:00.000Z'
        notes: Great handling of objection on pricing.
        tags:
          - sales
          - pricing
        quality: good
        category: objection-handling
        isArchived: false
        createdAt: '2026-05-18T14:30:00.000Z'
        updatedAt: '2026-05-18T14:30:00.000Z'
    TrainingSnapshotMessage:
      type: object
      properties:
        id:
          type: string
        content:
          type: string
        sender:
          type: string
          enum:
            - customer
            - user
        senderType:
          type: string
          description: Original sender type from the message (e.g. AI, HUMAN).
        timestamp:
          type: string
          format: date-time
        metadata:
          type: object
          properties:
            from:
              type: string
            to:
              type: string
          additionalProperties: true
      additionalProperties: true
      example:
        id: 67e0a0b0c0d0e0f0a0b0c0d0
        content: Hi! How can we help?
        sender: user
        senderType: AI
        timestamp: '2026-05-18T13:30:00.000Z'
        metadata:
          from: '+15555550100'
          to: '+14155550123'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````