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

# Upload Files

> Upload files for processing with automatic document type detection

## Upload Files

**POST** `/files/upload`

Upload files for processing with automatic document type detection. This endpoint supports multiple file formats and maintains backward compatibility with the existing upload endpoint.

### Features

* Supports PDF, JPG, JPEG, PNG formats
* Maximum 50 files per request, 10MB per file
* Automatic document type detection
* Maintains backward compatibility with existing upload endpoint

### Request

```bash theme={null}
curl -X POST "https://api.invaro.ai/api/v1/files/upload" \
  -H "Authorization: Bearer your_api_key" \
  -F "files=@document.pdf"
```

### Response

```json theme={null}
{
  "success": true,
  "data": {
    "files": [
      {
        "doc_id": "72f574a0-b3d2-4a0f-8527-f542e6ea7500",
        "type": "invoice",
        "validation": {
          "page_count": 1,
          "file_size": 84898,
          "format": "PDF"
        }
      }
    ],
    "status": "done"
  }
}
```

### Response Fields

| Field                   | Type    | Description                                                           |
| ----------------------- | ------- | --------------------------------------------------------------------- |
| `doc_id`                | string  | Unique identifier for the uploaded document                           |
| `type`                  | string  | Automatically detected document type (invoice, bank\_statement, etc.) |
| `validation.page_count` | integer | Number of pages in the document                                       |
| `validation.file_size`  | integer | File size in bytes                                                    |
| `validation.format`     | string  | File format (PDF, JPG, JPEG, PNG)                                     |
| `status`                | string  | Upload status ("done" when successful)                                |

## Try It Out

Use the interactive playground above to test the upload endpoint. You can:

1. **Add your API key** in the Authorization header
2. **Select files** to upload (PDF, JPG, JPEG, or PNG)
3. **Execute the request** to see the response

The playground will show you the exact curl command and response format.


## OpenAPI

````yaml POST /files/upload
openapi: 3.0.0
info:
  title: Invaro Document Processing API
  description: API for processing bank statements and invoices using OCR and AI
  version: 1.0.0
  contact:
    name: Invaro Support
    email: support@invaro.ai
    url: https://docs.invaro.ai
servers:
  - url: https://api.invaro.ai/api/v1
    description: Production API
security:
  - bearerAuth: []
paths:
  /files/upload:
    post:
      tags:
        - Files API
      summary: Upload Files (New API)
      description: >-
        Upload files for processing with automatic document type detection.
        Enhanced version of the legacy upload endpoint.
      operationId: uploadFiles
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - files
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: >-
                    Documents to upload (PDF, JPG, JPEG, PNG). Maximum 50 files
                    per request, 10MB per file.
                  example:
                    - document1.pdf
                    - document2.jpg
      responses:
        '200':
          description: Files uploaded successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      files:
                        type: array
                        items:
                          type: object
                          properties:
                            doc_id:
                              type: string
                              example: 72f574a0-b3d2-4a0f-8527-f542e6ea7500
                            type:
                              type: string
                              example: invoice
                            validation:
                              type: object
                              properties:
                                page_count:
                                  type: integer
                                  example: 1
                                file_size:
                                  type: integer
                                  example: 84898
                                format:
                                  type: string
                                  example: PDF
                      status:
                        type: string
                        example: done
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````