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

# Parse Text

> Process raw text data into structured document chunks.



## OpenAPI

````yaml post /parse/text/
openapi: 3.0.3
info:
  title: Lyzr Knowledge Base - Parse Text
  version: 1.0.0
  description: >-
    Accepts raw text data and processes it by chunking and embedding for use in
    a RAG system.
servers:
  - url: https://rag-prod.studio.lyzr.ai/v3
security: []
paths:
  /parse/text/:
    post:
      summary: Parse Text
      description: Process raw text data into structured document chunks.
      operationId: parseText
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - data
                - chunk_size
                - chunk_overlap
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/TextData'
                  description: Array of text objects to be parsed.
                  example:
                    - text: string
                      source: string
                      extra_info: {}
                chunk_size:
                  type: integer
                  description: Size of the chunks for text splitting.
                  example: 1000
                chunk_overlap:
                  type: integer
                  description: Overlap between consecutive text chunks.
                  example: 100
      responses:
        '200':
          description: Text successfully parsed and documents returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  documents:
                    type: array
                    items:
                      $ref: '#/components/schemas/Document'
                    description: List of processed document chunks.
        '422':
          description: Validation Error - Input format or missing fields.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        loc:
                          type: array
                          items:
                            oneOf:
                              - type: string
                              - type: integer
                        msg:
                          type: string
                        type:
                          type: string
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TextData:
      type: object
      properties:
        text:
          type: string
          description: The actual text content to be processed.
          example: string
        source:
          type: string
          description: Identifier for the source of the text (e.g., 'document_1.pdf').
          example: string
        extra_info:
          type: object
          description: Additional key-value metadata to associate with the text.
          example: {}
      required:
        - text
        - source
        - extra_info
    Document:
      type: object
      properties:
        id_:
          type: string
          description: Unique identifier for the processed document chunk.
          example: 1140ba4e-e5f5-4999-a5d6-4263f2c48b57
        embedding:
          type: object
          nullable: true
          description: Placeholder for the text embedding (null if not yet computed).
        metadata:
          type: object
          properties:
            source:
              type: string
            chunked:
              type: boolean
          description: Metadata about the chunking and source.
        text:
          type: string
          description: The text content of the chunk.
          example: string
        excluded_embed_metadata_keys:
          type: array
          items:
            type: string
        excluded_llm_metadata_keys:
          type: array
          items:
            type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````