> ## 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.

# Download File

> Download the original file content with proper headers

## Download File

**GET** `/files/{file_id}/download`

Download the original file content with preserved filename and content type. Streams file efficiently without loading into memory.

### Features

* Preserves original filename and content type
* Efficient streaming without memory loading
* Proper content disposition headers
* User ownership validation

### Parameters

| Parameter | Type   | Required | Description                               |
| --------- | ------ | -------- | ----------------------------------------- |
| `file_id` | string | Yes      | Unique identifier of the file to download |

### Request

```bash theme={null}
curl "https://api.invaro.ai/api/v1/files/72f574a0-b3d2-4a0f-8527-f542e6ea7500/download" \
  -H "Authorization: Bearer your_api_key" \
  -o "downloaded_file.pdf"
```

### Response Headers

```
Content-Type: application/pdf
Content-Disposition: attachment; filename="invoice.pdf"
Content-Length: 84898
```

### Response

The response will be the binary file content with appropriate headers set for download.

### Response Headers

| Header                | Description                       |
| --------------------- | --------------------------------- |
| `Content-Type`        | MIME type of the original file    |
| `Content-Disposition` | Attachment with original filename |
| `Content-Length`      | File size in bytes                |

### Supported File Types

| Format | MIME Type         |
| ------ | ----------------- |
| PDF    | `application/pdf` |
| JPG    | `image/jpeg`      |
| JPEG   | `image/jpeg`      |
| PNG    | `image/png`       |

### Error Responses

* **404 Not Found**: File doesn't exist or user doesn't have access
* **410 Gone**: File has been deleted
* **500 Internal Server Error**: File storage issue

## Try It Out

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

1. **Add your API key** in the Authorization header
2. **Enter a file ID** in the path parameter (use a UUID from your uploaded files)
3. **Execute the request** to download the original file

**Note**: The playground will show response headers, but for actual file download, use the generated curl command or your HTTP client.


## OpenAPI

````yaml GET /files/{file_id}/download
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/{file_id}/download:
    parameters:
      - name: file_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Unique identifier of the file to download
        example: 72f574a0-b3d2-4a0f-8527-f542e6ea7500
    get:
      tags:
        - Files API
      summary: Download File
      description: Download the original file content with proper headers
      operationId: downloadFile
      responses:
        '200':
          description: File content
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
            image/png:
              schema:
                type: string
                format: binary
          headers:
            Content-Disposition:
              schema:
                type: string
              description: attachment; filename="original_filename.ext"
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````