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

# Upload a file (or batch of files)

> Uploads one or more files to the files connector. Each file is:
1. Validated (extension allowlist + 50 MB per-file cap + MIME-type sniff)
2. Stored in MinIO under the `knowledgeSources/` prefix
3. Converted to Markdown (Firecrawl for office/PDF, Cortex vision LLM for images, direct read for .md/.txt)
4. Saved as a `knowledge_sources` row with `type='file'`
5. Triggers a `knowledgeSourceChanged` event for Cortex indexing

**Single-file mode** (backward-compatible): send `name="file"` — response is `{success, id}`.

**Batch mode**: send `name="files[]"` with multiple parts — response is `{successful: [{id, name}], failed: [{name, error}]}`. Max 20 files and 50 MB total per request. Files are processed in parallel via Amp futures. Per-file errors land in `failed` without aborting the batch.




## OpenAPI

````yaml https://dev.enneo.dev/api/mind/docs/open-api post /knowledgeSource/filesConnector/upload
openapi: 3.0.0
info:
  version: '1'
  title: enneo.MIND API
  description: This describes the API of enneo Mind, the main ticketing backend
  contact:
    name: enneo GmbH
    email: richard@enneo.ai
  license:
    name: Proprietary software
    url: https://enneo.ai
servers:
  - url: https://demo.enneo.ai/api/mind
    description: Production server, demo client
  - url: https://main.enneo.dev/api/mind
    description: Development main branch
  - url: http://localhost:8005/api/mind
    description: Local development server
security:
  - bearerAuth:
      - api
  - cookieAuth:
      - api
paths:
  /knowledgeSource/filesConnector/upload:
    post:
      tags:
        - Files connector
      summary: Upload a file (or batch of files)
      description: >
        Uploads one or more files to the files connector. Each file is:

        1. Validated (extension allowlist + 50 MB per-file cap + MIME-type
        sniff)

        2. Stored in MinIO under the `knowledgeSources/` prefix

        3. Converted to Markdown (Firecrawl for office/PDF, Cortex vision LLM
        for images, direct read for .md/.txt)

        4. Saved as a `knowledge_sources` row with `type='file'`

        5. Triggers a `knowledgeSourceChanged` event for Cortex indexing


        **Single-file mode** (backward-compatible): send `name="file"` —
        response is `{success, id}`.


        **Batch mode**: send `name="files[]"` with multiple parts — response is
        `{successful: [{id, name}], failed: [{name, error}]}`. Max 20 files and
        50 MB total per request. Files are processed in parallel via Amp
        futures. Per-file errors land in `failed` without aborting the batch.
      operationId: uploadFilesConnectorFile
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    Single-file upload (backward-compatible). Mutually exclusive
                    with `files[]`.
                files[]:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: >-
                    Batch upload — multiple files as `name="files[]"`. Max 20
                    files, 50 MB total.
                folderId:
                  type: integer
                  description: >-
                    Folder structure ID to place the file(s) in. Defaults to the
                    connector root.
                  example: 11
      responses:
        '200':
          description: >
            Single-file: `{success: true, id: N}`.

            Batch: `{successful: [{id, name}], failed: [{name, error}]}` — HTTP
            200 even when some files failed.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/FileUploadResponse'
                  - $ref: '#/components/schemas/BatchFileUploadResponse'
        '400':
          description: Incomplete upload (partial transfer)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: File or total batch size exceeds limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            No file provided, unsupported type, MIME spoofing, or too many files
            in batch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    FileUploadResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        id:
          type: integer
          description: ID of the created knowledge_sources row
          example: 42
    BatchFileUploadResponse:
      type: object
      properties:
        successful:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                description: ID of the created knowledge_sources row
                example: 42
              name:
                type: string
                description: Original filename
                example: invoice.pdf
        failed:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: Original filename
                example: corrupt.pdf
              error:
                type: string
                description: Error message
                example: Unsupported file type for 'corrupt.pptx'
    Error:
      type: object
      description: Data format of Enneo error messages
      properties:
        error:
          type: string
          example: Contract 121 could not be processed
          description: Readable error message that should be shown to the user
        details:
          type: string
          example: >-
            Uncatched null point exception in testFunction() in
            /app/src/file:212
          description: Not easily readable error message that is for the developer
        txId:
          type: string
          example: c916167c94
          description: >-
            Internal transaction id. Useful for debugging. Corresponds to the
            OpenTelemetry trace ID.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT-based authentication
      x-scopes:
        api: Full access to the API
    cookieAuth:
      type: apiKey
      in: cookie
      name: connect.sid
      description: Cookie-based authentication
      x-scopes:
        api: Full access to the API

````