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

# Create training data

> Supported types:
- text: requires content
- file: requires multipart file upload
- video: requires video_url
- qa: requires question + answer
- url: not accepted directly in this endpoint (use POST /training-data/url/process)
The API does not accept `metadata` in requests.




## OpenAPI

````yaml /api-reference/openapi.json post /training-data
openapi: 3.1.0
info:
  title: Weav API
  version: 1.0.0
  description: |
    Public API for Weav workspace integrations.
    Base URL is versioned under /v1 and requires bearer token authentication.
    Token abilities are enforced:
    - `external-api:read` for read endpoints
    - `external-api:write` for write endpoints
    - `external-api:write` also grants read access
servers:
  - url: https://api.weav.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Agents
  - name: Companies
  - name: Conversations
  - name: Customers
  - name: Messages
  - name: Training Data
  - name: Webhooks
paths:
  /training-data:
    post:
      tags:
        - Training Data
      summary: Create training data
      description: >
        Supported types:

        - text: requires content

        - file: requires multipart file upload

        - video: requires video_url

        - qa: requires question + answer

        - url: not accepted directly in this endpoint (use POST
        /training-data/url/process)

        The API does not accept `metadata` in requests.
      operationId: createTrainingData
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrainingDataCreateJsonRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TrainingDataCreateFileRequest'
      responses:
        '201':
          description: Training data created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingData'
        '400':
          description: Invalid type or business rule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          description: Creation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    TrainingDataCreateJsonRequest:
      oneOf:
        - type: object
          required:
            - type
            - content
          properties:
            type:
              type: string
              enum:
                - text
            content:
              type: string
            title:
              type: string
              nullable: true
              maxLength: 255
            description:
              type: string
              nullable: true
            agent_ids:
              type: array
              items:
                type: string
                format: uuid
              nullable: true
        - type: object
          required:
            - type
            - video_url
          properties:
            type:
              type: string
              enum:
                - video
            video_url:
              type: string
              format: uri
            title:
              type: string
              nullable: true
              maxLength: 255
            agent_ids:
              type: array
              items:
                type: string
                format: uuid
              nullable: true
        - type: object
          required:
            - type
            - question
            - answer
          properties:
            type:
              type: string
              enum:
                - qa
            question:
              type: string
            answer:
              type: string
            title:
              type: string
              nullable: true
              maxLength: 255
            agent_ids:
              type: array
              items:
                type: string
                format: uuid
              nullable: true
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - url
          description: >-
            URL direct create is not supported (use POST
            /training-data/url/process)
    TrainingDataCreateFileRequest:
      type: object
      required:
        - type
        - file
      properties:
        type:
          type: string
          enum:
            - file
        file:
          type: string
          format: binary
          description: Allowed mimes pdf,doc,docx,txt,md (max 10MB)
        title:
          type: string
          nullable: true
          maxLength: 255
        agent_ids:
          type: array
          items:
            type: string
            format: uuid
    TrainingData:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - text
            - url
            - file
            - video
            - qa
        source:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        slug:
          type: string
          nullable: true
        is_processed:
          type: boolean
        status:
          type: string
          enum:
            - queued
            - processing
            - completed
            - failed
          nullable: true
        training_folder_id:
          type: string
          format: uuid
          nullable: true
        created_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error message
        code:
          type: string
          nullable: true
          example: UNAUTHENTICATED
        errors:
          type: object
          additionalProperties: true
          nullable: true
    ValidationError:
      type: object
      properties:
        message:
          type: string
          example: The given data was invalid.
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Token
      description: |
        Workspace API token.
        Include abilities `external-api:read` and/or `external-api:write`.

````