---
title: "Download File"
method: GET
path: "/api/files/{file_id}/download"
tags: ["files", "files"]
---

# Download File

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

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/files/{file_id}/download`
- Auth: none declared

Download the latest version of a file.

By default, redirects to a presigned URL for direct download from storage (fast).
Use ?direct=true to download through the API gateway (slower, for debugging).
Use ?url_only=true to get the presigned URL as JSON (for CORS-safe frontend fetching).

## Path parameters

- `file_id` integer, required

## Query parameters

- `direct` boolean: If true, download through gateway instead of redirect
- `url_only` boolean: If true, return presigned URL as JSON instead of redirect
- `attachment` boolean: If true, the presigned URL answers as a file to save, not one to show

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/77bef09a9209?raw)
