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

# Upload File

> Upload a document and receive a `file://<uuid>` URI. Use this URI as the `input` parameter in parse, extract, and classify endpoints.

Supported formats: PDF, Word, Excel, PowerPoint, images (PNG, JPG, TIFF, BMP, WebP).



## OpenAPI

````yaml /openapi-extraction-v2.json post /api/v2/files
openapi: 3.1.0
info:
  title: Nanonets V2 API
  description: >-
    Stateful document processing API with file management, reusable configs, and
    JSON-body endpoints for parse, extract, and classify operations.


    **Key differences from V1:**

    - JSON request bodies instead of multipart/form-data

    - Upload files once via `POST /files`, then reference them with
    `file://<uuid>` URIs

    - Save and reuse processing configurations via `config://<uuid>` URIs

    - Batch processing via list inputs on async endpoints (up to 50 items)

    - Document classification with `document` and `split` modes
  version: 2.0.0
  contact:
    name: Nanonets Support
    email: info@nanonets.com
servers:
  - url: https://extraction-api.nanonets.com
    description: Production
security:
  - BearerAuth: []
paths:
  /api/v2/files:
    post:
      tags:
        - File Upload
      summary: Upload File
      description: >-
        Upload a document and receive a `file://<uuid>` URI. Use this URI as the
        `input` parameter in parse, extract, and classify endpoints.


        Supported formats: PDF, Word, Excel, PowerPoint, images (PNG, JPG, TIFF,
        BMP, WebP).
      operationId: v2_upload_file
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: Document file to upload
      responses:
        '201':
          description: File uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUploadResponse'
              example:
                success: true
                file_id: file://a1b2c3d4-e5f6-7890-abcd-ef1234567890
                filename: invoice.pdf
                content_type: application/pdf
                file_size: 245890
                message: File uploaded successfully
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    FileUploadResponse:
      type: object
      required:
        - success
        - file_id
        - filename
        - message
      properties:
        success:
          type: boolean
        file_id:
          type: string
          description: '`file://<uuid>` URI for use in parse/extract/classify endpoints'
          example: file://a1b2c3d4-e5f6-7890-abcd-ef1234567890
        filename:
          type: string
        content_type:
          type: string
        file_size:
          type: integer
          description: Size in bytes
        message:
          type: string
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
  responses:
    BadRequest:
      description: Invalid input
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'API key as Bearer token: `Authorization: Bearer YOUR_API_KEY`'

````