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

# Create a text data source

> Add a text-based data source to train your agent. Text data sources are useful for adding custom content, documentation, or knowledge base articles.



## OpenAPI

````yaml post /api/v2/data-sources/text
openapi: 3.0.1
info:
  title: LiveChatAI API v2
  description: >-
    LiveChatAI API v2 - Build powerful AI-powered customer support experiences.
    This API follows REST principles with predictable, resource-oriented URLs,
    JSON responses, and standard HTTP methods.
  version: 2.0.0
servers:
  - url: https://app.livechatai.com
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/v2/data-sources/text:
    post:
      tags:
        - Data Sources
      summary: Create a text data source
      description: >-
        Add a text-based data source to train your agent. Text data sources are
        useful for adding custom content, documentation, or knowledge base
        articles.
      requestBody:
        required: true
        description: Details for the text data source.
        content:
          application/json:
            schema:
              type: object
              required:
                - title
                - content
                - agentId
              properties:
                title:
                  type: string
                  example: Company Overview
                  description: Title of the text data source
                content:
                  type: string
                  example: >-
                    Our company specializes in AI-powered agent solutions that
                    help businesses automate customer support...
                  description: Content of the text data source
                agentId:
                  type: string
                  example: clx1234567890abcdef
                  description: Unique identifier of the agent
      responses:
        '200':
          description: Text data source created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Added successfully
                      item:
                        type: object
                        properties:
                          id:
                            type: string
                            example: ds_1234567890
                          source:
                            type: string
                            example: TEXT
                          isGeneratedByAI:
                            type: boolean
                            example: false
        '401':
          description: Unauthorized access
        '406':
          description: Character limit exceeded.
        '500':
          description: An internal server error occurred.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````