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

# Upload Documents

> Upload multiple documents.

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

- `files`: List of files to upload (required)
- `categories` (optional): List of category names to organize documents


**Returns:**

`list[str]` containing:

- List of unique IDs (strings) for tracking upload and processing status
- One ID is returned for each uploaded file
- Use these IDs to monitor processing progress

**Supported File Types:**
- Text-based files only

**File Size Limit:**

Maximum 100 MB per file


**Example Request:**

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

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


**Example Response:**

```json
[
  "01KKBB7NPTMXM12",
  "01KKBB7NPTJDK43"
]
```



## OpenAPI

````yaml https://api.nugen.in/openapi-public.json post /api/v3/documents
openapi: 3.1.0
info:
  title: Nugen Intelligence API
  description: 'Nugen Intelligence : Powering Specialized Intelligence At Scale'
  version: 25.4.20
servers: []
security: []
paths:
  /api/v3/documents:
    post:
      tags:
        - Documents
      summary: Upload Documents
      description: |-
        Upload multiple documents.

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

        - `files`: List of files to upload (required)
        - `categories` (optional): List of category names to organize documents


        **Returns:**

        `list[str]` containing:

        - List of unique IDs (strings) for tracking upload and processing status
        - One ID is returned for each uploaded file
        - Use these IDs to monitor processing progress

        **Supported File Types:**
        - Text-based files only

        **File Size Limit:**

        Maximum 100 MB per file


        **Example Request:**

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

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


        **Example Response:**

        ```json
        [
          "01KKBB7NPTMXM12",
          "01KKBB7NPTJDK43"
        ]
        ```
      operationId: upload_documents_task
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_documents_task'
        required: true
      responses:
        '200':
          description: >-
            Returns a list of task IDs for the uploaded documents. This endpoint
            handles the upload of multiple documents, creates id for each
            document, and returns their unique task identifiers for tracking the
            upload and processing status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadDocumentsTaskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Body_upload_documents_task:
      properties:
        files:
          items:
            type: string
            format: binary
          type: array
          title: Files
          description: The document files to upload
        categories:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Categories
          description: Categories for the documents
      type: object
      required:
        - files
      title: Body_upload_documents_task
    UploadDocumentsTaskResponse:
      properties:
        document_ids:
          items:
            type: string
          type: array
          title: Document Ids
          description: >-
            List of task identifiers for the uploaded documents. Use these IDs
            with the upload status endpoint to track processing progress and
            retrieve the final document IDs.
      type: object
      required:
        - document_ids
      title: UploadDocumentsTaskResponse
      examples:
        - document_ids:
            - 01KR0WS1KFPREDV
        - document_ids:
            - 01KR0WS1KFPREDV
            - 01KR0WS2ABCD123
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````