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

# File Retrieval

> Retrieve original uploads and generated files from analysis results

Every analysis (fraud detection, parsing, verification) stores associated files in cloud storage. Use the File Retrieval API to download original uploads and generated assets like heatmaps.

## Retrieving a File

Each analysis response includes a `files` array with download URLs. Use the file name from the URL to retrieve the file:

```bash theme={null}
curl https://api.deepxl.ai/v1/files/fd_42_bank_statement.pdf \
  -H "x-api-key: YOUR_API_KEY" \
  --output bank_statement.pdf
```

The endpoint returns the file as a binary stream with the appropriate `Content-Type` header.

## File Categories

Files in analysis responses are categorized by their role:

| Category        | Service                  | Description                                          |
| --------------- | ------------------------ | ---------------------------------------------------- |
| `original_file` | Fraud Detection, Parsing | The file you originally uploaded                     |
| `heatmap`       | Fraud Detection          | Generated heatmap highlighting detected manipulation |
| `id`            | Verification             | The ID document image                                |
| `face`          | Verification             | The selfie image                                     |

## Finding File URLs

File URLs are included in every analysis response under the `files` array:

```json theme={null}
{
  "files": [
    {
      "category": "original_file",
      "fileName": "bank_statement.pdf",
      "fileSize": 245678,
      "contentType": "application/pdf",
      "timestamp": 1735689600000,
      "timestampISO": "2025-01-01T00:00:00.000Z",
      "url": "https://api.deepxl.ai/v1/files/fd_42_bank_statement.pdf"
    },
    {
      "category": "heatmap",
      "fileName": "fd_42_heatmap_1.png",
      "fileSize": 45678,
      "contentType": "image/png",
      "timestamp": 1735689601000,
      "timestampISO": "2025-01-01T00:00:01.000Z",
      "url": "https://api.deepxl.ai/v1/files/fd_42_heatmap_1.png"
    }
  ]
}
```

## Access Control

Files are scoped to your organization. You can only retrieve files associated with your own analyses. Attempting to access another organization's files returns a `404`.
