---
title: "downloadFile"
method: GET
path: "/v1/files/{id}/download"
tags: ["File"]
---

# downloadFile

`GET /v1/files/{id}/download`

Generate a pre-signed download URL for a file.

The returned URL is valid for a limited time (typically 15 minutes) and can be used to download the file directly.

**Download attribution (`x-track-*`):** any query parameter whose name starts with
`x-track-` is treated as opaque tracking metadata and signed into the returned URL, so it
shows up in the S3 access logs / CloudTrail data events when the link is actually opened.
This is a generic, service-agnostic channel — e.g. the customer portal sends
`x-track-portal-id` and `x-track-contact-id`. Only the `x-track-` namespace is forwarded;
the values cannot affect how S3 resolves or serves the object. Parameter names must match
`^x-track-[a-z0-9](?:[a-z0-9_-]{0,38}[a-z0-9])?$`, values are capped at 256 characters, and
at most 10 such parameters are honoured (see the `x-track` parameter below).

## Path parameters

- `id` union, required
  - string — Empty string (used when file ID not yet assigned)
  - string, uuid — Valid UUID v4

## Query parameters

- `version` integer
- `attachment` boolean
- `x-track` object

## Response `200`

Pre-signed download URL

- object
  - `download_url` string, uri — Pre-signed S3 URL valid for downloading the file

## Other responses

- `401` — Authentication required or invalid credentials
- `403` — Insufficient permissions to access the resource
- `404` — The requested resource was not found
- `500` — An unexpected error occurred on the server

---

[API](https://skmtc.net/epilot/apis/file-api.md) · [All operations](https://skmtc.net/epilot/apis/file-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/epilot/file-api/revisions/4d61b97f1e97/schema)
