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

# Upload PDFs, Word documents and text

> Ingest content that lives on no website and in no repository: PDF manuals, Word documents, Markdown, plain text and source files, within the upload limits.

Upload files that do not live on a website or in a repository, such as PDF manuals, Word documents or exported pages.

Your own interface can read the ceilings before it sends anything, with [Read the upload limits](/api-reference/knowledge/upload-limits), so a file that is too large is refused by you rather than by a failed upload.

## Supported files

| Type                   | Extensions                                                                                                                                      |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| PDF                    | `.pdf`                                                                                                                                          |
| Word                   | `.docx`                                                                                                                                         |
| Markdown               | `.md`, `.markdown`, `.mdx`                                                                                                                      |
| Plain text             | `.txt`, `.text`                                                                                                                                 |
| reStructuredText       | `.rst`                                                                                                                                          |
| HTML                   | `.html`, `.htm`                                                                                                                                 |
| Source code and config | `.py`, `.ts`, `.js`, `.go`, `.java`, `.rb`, `.cs`, `.yaml`, `.json`, `.sql` and more. See [Upload files](/api-reference/knowledge/upload-files) |

The type is decided by the file extension. Legacy `.doc` files, spreadsheets and slide decks are not supported; export them to PDF or `.docx` first. Scanned PDFs without a text layer contain no extractable text.

## Limits

* Each file can be up to **1 MiB** by default. Your MITHUNAI administrator sets this limit for the deployment and can raise it. The console does not show the figure, because it is deployment configuration; a file over the limit is refused with a message saying so.
* Up to 1,000 files and 64 MiB per upload request.
* If any file in a batch is unacceptable, the whole batch is refused and nothing is stored. Fix or remove that file and upload again.

## Upload in the console

1. Open **Knowledge** and select **Connect a knowledge source**.
2. Choose **File upload** and select your file.
3. Save. The file is stored and ingestion starts.

## Upload with the API

Uploading is two steps: store the files, then register an `upload` source that refers to them.

<Steps>
  <Step title="Upload the files">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    curl --request POST "$MITHUNAI_URL/arukz/api/v1/knowledge/uploads" \
      --header "Authorization: Bearer $MITHUNAI_API_KEY" \
      --form "collection_id=<collection id>" \
      --form "file=@handbook.pdf" \
      --form "file=@runbook.md"
    ```

    The response lists the accepted files and includes a ready-made `configuration` object.
  </Step>

  <Step title="Register the source">
    Post the `configuration` from step 1 back unchanged:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    curl --request POST "$MITHUNAI_URL/arukz/api/v1/knowledge/sources" \
      --header "Authorization: Bearer $MITHUNAI_API_KEY" \
      --header "Content-Type: application/json" \
      --data '{
        "collection_id": "<collection id>",
        "source_type": "upload",
        "name": "Handbooks",
        "configuration": { "files": "<files value from step 1>" }
      }'
    ```
  </Step>

  <Step title="Sync it">
    [Sync the source](/api-reference/knowledge/sync-source) to ingest the files, then follow the job as described in [Ingestion](/knowledge/ingestion).
  </Step>
</Steps>

<Tip>
  In a script, pass the upload response's `configuration` object straight into the source request
  rather than rebuilding it. Its `files` value is a newline-separated manifest that is easy to get
  wrong by hand.
</Tip>

## Update an uploaded document

Upload the new version and create a new `upload` source for it, then delete the old source. Deleting a source removes its documents from retrieval immediately.
