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

# Upload Document

> Upload and process a document to create knowledge entries using Docling



## OpenAPI

````yaml /api-reference/openapi/EvoAI-Knowledge-Service/knowledge.yaml post /api/v1/knowledge/upload-document
openapi: 3.1.0
info:
  title: Evolution Foundation - Knowledge Service - Knowledge
  description: Knowledge base and memory management
  version: 1.0.0
servers:
  - url: https://api.evoai.app
    description: Production server
  - url: http://localhost:3005
    description: Development server
    variables:
      port:
        default: '3005'
  - url: '{customUrl}'
    description: Custom server
    variables:
      customUrl:
        default: https://your-instance.com
        description: Enter your server URL
security: []
paths:
  /api/v1/knowledge/upload-document:
    post:
      summary: Upload Document
      description: Upload and process a document to create knowledge entries using Docling
      operationId: upload_document_api_v1_knowledge_upload_document_post
      parameters:
        - name: x-knowledge-base-config-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: X-Knowledge-Base-Config-Id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_upload_document_api_v1_knowledge_upload_document_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_DocumentProcessResponse_'
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: >-
                    Invalid tags format, unsupported file format, or invalid
                    account ID
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/knowledge/upload-document
                  method: POST
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing authentication token
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/knowledge/upload-document
                  method: POST
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/knowledge/upload-document
                  method: POST
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Knowledge base configuration not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/knowledge/upload-document
                  method: POST
        '413':
          description: Request entity too large - file exceeds 50MB limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: PAYLOAD_TOO_LARGE
                  message: File exceeds 50MB limit
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/knowledge/upload-document
                  method: POST
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error (server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /api/v1/knowledge/upload-document
                  method: POST
components:
  schemas:
    Body_upload_document_api_v1_knowledge_upload_document_post:
      properties:
        file:
          type: string
          format: binary
          title: File
          description: Document file to process
        client_id:
          type: string
          format: uuid
          title: Client Id
          description: Client ID that will own the knowledge
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
          description: Custom title for the document
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Custom description for the document
        tags:
          anyOf:
            - type: string
            - type: 'null'
          title: Tags
          description: Custom tags for the document (JSON array)
        chunk_size:
          type: integer
          maximum: 10000
          minimum: 1000
          title: Chunk Size
          description: Size of text chunks for large documents
          default: 5000
        overlap_size:
          type: integer
          maximum: 1000
          minimum: 0
          title: Overlap Size
          description: Overlap between chunks
          default: 200
      type: object
      required:
        - file
        - client_id
      title: Body_upload_document_api_v1_knowledge_upload_document_post
    SuccessResponse_DocumentProcessResponse_:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: true
        data:
          $ref: f66c8524-c773-4662-950c-4674f2b2c2c2
          description: Response payload
        meta:
          $ref: 39662c72-c96e-4dc1-a63a-ba5d2a02e7b7
          description: Metadata
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: Optional success message
      type: object
      required:
        - data
        - meta
      title: SuccessResponse[DocumentProcessResponse]
    ErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Success indicator
          default: false
        error: 44fed242-ed8c-42cc-a258-fde42f1bc71d
        meta:
          $ref: 48ef82b8-8963-4261-ab68-ad7060264785
          description: Metadata
      type: object
      required:
        - error
        - meta
      title: ErrorResponse
      description: |-
        Standard error response schema matching error_response() return format.

        This schema matches the structure returned by error_response() function,
        which always uses ErrorInfo for the error field.
    HTTPValidationError:
      properties:
        detail:
          items: 913403a9-6f2a-44b1-a051-78abecca0208
          type: array
          title: Detail
      type: object
      title: HTTPValidationError

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.