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

> Creates a new text-based knowledge base entry. Use this endpoint to add custom text content that agents can reference during conversations.  **Processing:** Accepts a title and text content, converts

# Create Text Entry

For the complete error reference, see [Error Guide](/rest-api/ai-agents-apis/error-codes).


## OpenAPI

````yaml post /ai-agents/agent-builder/knowledge-base/text
openapi: 3.0.0
info:
  title: AI Agents APIs
  description: API reference for CometChat AI Agents service
  version: '1.0'
servers:
  - url: https://{appId}.api-{region}.cometchat.io/v3
    variables:
      appId:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security: []
tags:
  - name: ai-agent
    description: ''
paths:
  /ai-agents/agent-builder/knowledge-base/text:
    post:
      tags:
        - knowledge-base
      summary: Create Text Entry
      description: >-
        Creates a new text-based knowledge base entry. Use this endpoint to add
        custom text content that agents can reference during conversations.


        **Processing:** Accepts a title and text content, converts it to a
        Markdown file, and adds it to the knowledge base for indexing.
      operationId: RagController_createTextDetail
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTextDetailDto'
            examples:
              example1:
                summary: Create a text detail
                value:
                  title: Company Policy Document
                  text: >-
                    This document outlines the company policies and procedures
                    for remote work, including communication guidelines, working
                    hours expectations, and performance metrics.
      responses:
        '201':
          description: Text detail created and uploaded to S3 successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Text detail created and uploaded successfully
                  data:
                    type: object
                    properties:
                      uniqueId:
                        type: string
                        description: Unique identifier for the text detail
                      title:
                        type: string
                        description: Title of the text detail
                      fileName:
                        type: string
                        description: Generated .md file name
                      s3Key:
                        type: string
                        description: S3 object key for the uploaded file
                      status:
                        type: string
                        description: Current processing status
                        example: indexing
              example:
                success: true
                message: Text detail created and uploaded successfully
                data:
                  uniqueId: f47ac10b-58cc-4372-a567-0e02b2c3d479
                  title: Company Policy Document
                  fileName: company-policy-document.md
                  s3Key: my-app-id/text/f47ac10b/company-policy-document.md
                  status: indexing
      security:
        - apiKey: []
components:
  schemas:
    CreateTextDetailDto:
      type: object
      properties:
        title:
          type: string
          description: Title of the text content
          example: Company Policy Document
          maxLength: 500
        text:
          type: string
          description: Text content to be processed
          example: This document outlines the company policies and procedures...
          maxLength: 5000
      required:
        - title
        - text
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key (i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````