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

# Parse Documents

> This endpoint used to parse the documents and extract text from them.



## OpenAPI

````yaml POST /documents/parse
openapi: 3.1.0
info:
  title: Pawa AI APIs
  description: >-
    API endpoints in Pawa Platform to perform CRUD operations on different
    features using Pawa AI, a digital assistant built for Africa for various
    tasks.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.pawa-ai.com/v1
    description: Production Server
security:
  - bearerAuth: []
paths:
  /documents/parse:
    post:
      tags:
        - Parse documents
      summary: Parse documents
      description: This endpoint used to parse the documents and extract text from them.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                documents:
                  type: array
                  items:
                    type: string
                    format: binary
                  maxItems: 25
                  minItems: 1
                  description: >-
                    List of files. One or more documents (max 25) to be parsed.
                    Supports PDF, DOCX, Excell, PPT, TXT, audio, and images.
                model:
                  type: string
                  default: pawa-v1-parser-20250809
                  enum:
                    - pawa-v1-parser-20250809
                prompt:
                  type: string
                  description: Parsing instructions or context for better results.
              required:
                - documents
                - model
      responses:
        '200':
          description: Documents parsed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsParsingResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                badRequest:
                  value:
                    success: false
                    message: Invalid input provided
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  value:
                    success: false
                    message: Unauthorized access
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                forbidden:
                  value:
                    success: false
                    message: You do not have permission to access this resource
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  value:
                    success: false
                    message: Resource does not exist
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                tooManyRequests:
                  value:
                    success: false
                    message: Rate limit exceeded. Please try again later.
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                serverError:
                  value:
                    success: false
                    message: Internal server error
components:
  schemas:
    DocumentsParsingResponseDto:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Documents parsed successfully
        data:
          type: array
          items:
            $ref: '#/components/schemas/DocumentsParsingData'
      required:
        - success
        - message
        - data
    ErrorResponse:
      required:
        - success
        - message
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: An error occurred
    DocumentsParsingData:
      type: object
      properties:
        fileName:
          type: string
          example: file.pdf
        fileType:
          type: string
          example: application/pdf
        fileSize:
          type: number
          example: 123456
        content:
          type: string
          example: This is the content of the document.
      required:
        - fileName
        - fileType
        - fileSize
        - content
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````