---
title: "Upload Documents"
method: POST
path: "/api/v3/documents/create"
tags: ["Documents"]
---

# Upload Documents

`POST /api/v3/documents/create`

## Request

- Base URL: `https://api.nugen.in`
- URL: `https://api.nugen.in/api/v3/documents/create`
- Auth: HTTP bearer

Upload multiple documents.

**Request Body (multipart/form-data):**

- `files`: List of files to upload (required)
- `categories` (optional): List of category names to organize documents
- `names` (optional): List of display names, matched to files by position


**Returns:**

- `documents`: One unique document id per uploaded file, for status polling and later use

**Supported File Types:**
- Text-based files only
- Each document needs at least 500 words; training dataset JSONL files are exempt. If any file is shorter, the whole upload is refused with 400 naming each short file

**Editions:**

The developer edition accepts plain text files only. PDF and other formats are available on the enterprise edition, which also accepts cloud storage URIs (`s3://`, `gs://`, `oci://`, `abfss://`) as the data source.

**File Size Limit:**

Maximum 100 MB per file


**Example Request:**

```
POST /api/v3/documents/create
Headers: {"Authorization": "Bearer <api_key>"}
Content-Type: multipart/form-data

Form Data:
  files: [report.txt, analysis.md]
  categories: ["financial", "2024-q1"]
```


**Example Response:**

```json
{"document_ids": ["01KKBB7NPTMXM12", "01KKBB7NPTJDK43"]}
```


**Processing:**

Uploads are processed asynchronously. Poll `GET /api/v3/documents/{id}/status` until READY before using a document id elsewhere. Requires organisation membership.

## Request body `multipart/form-data`

- BodyDocumentsCreate: Multipart form to upload documents.
  - `files` string[], required: The document files to upload. Plain text files, each at least 500 words, except training dataset JSONL files. If any file is shorter, the whole upload is refused with a 400 naming each short file.
  - `categories` string[], nullable: Categories for the documents
  - `names` string[], nullable: Display names for the documents, matched to files by position. Defaults to each document id if omitted.

## Response `200`

Returns a list of document IDs.

- DocumentCreateResponse: Acknowledgement of uploaded documents, with their ids.
  - `document_ids` string[], required: List of unique document IDs for the uploaded documents. Use these IDs to track processing status, update categories, or download the documents.

## Other responses

- `401`: Invalid API key
- `403`: Authorization header missing or not a Bearer token
- `422`: Validation Error

---

[API](https://skmtc.dev/nugen/apis/nugen-intelligence-api.md) - [All operations](https://skmtc.dev/nugen/apis/nugen-intelligence-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nugen/apis/nugen-intelligence-api/revisions/62baa7960a4a?raw)
