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

# Create Text Document

> Create a knowledge base document containing the provided text.



## OpenAPI

````yaml https://api.threetone.in/openapi.json post /v1/voiceai/knowledge-base/text
openapi: 3.1.0
info:
  title: Threetone API Documentation
  version: 1.0.0
servers:
  - url: https://api.threetone.in
    description: Production
security: []
paths:
  /v1/voiceai/knowledge-base/text:
    post:
      tags:
        - Knowledge Base
      summary: Create Text Document
      description: Create a knowledge base document containing the provided text.
      operationId: create_text_document_route
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTextDocumentRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddKnowledgeBaseResponseModel'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    CreateTextDocumentRequest:
      properties:
        text:
          type: string
          title: Text
          description: Text content to be added to the knowledge base.
        name:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Name
          description: A custom, human-readable name for the document.
        parent_folder_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Folder Id
          description: >-
            If set, the created document or folder will be placed inside the
            given folder.
      type: object
      required:
        - text
      title: Body_Create_text_document_v1_convai_knowledge_base_text_post
      description: |-
        Request body for POST /knowledge-base/text endpoint.
        Creates a knowledge base document containing the provided text.
    AddKnowledgeBaseResponseModel:
      properties:
        id:
          type: string
          title: Id
          description: The ID of the created document
        name:
          type: string
          title: Name
          description: The name of the created document
        folder_path:
          items:
            $ref: '#/components/schemas/KnowledgeBaseFolderPathSegmentResponseModel'
          type: array
          title: Folder Path
          description: >-
            The folder path segments leading to this entity, from root to parent
            folder.
      type: object
      required:
        - id
        - name
      title: AddKnowledgeBaseResponseModel
      description: |-
        Response model for all document creation endpoints (URL, text, file).
        Returns the created document's ID, name, and folder path.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    KnowledgeBaseFolderPathSegmentResponseModel:
      properties:
        id:
          type: string
          title: Id
          description: Folder ID
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Folder name
      type: object
      required:
        - id
      title: KnowledgeBaseFolderPathSegmentResponseModel
      description: Folder path segment for hierarchical navigation
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: API key for programmatic access
      in: header
      name: x-api-key
    HTTPBearer:
      type: http
      description: JWT Bearer token for dashboard access
      scheme: bearer

````