---
title: "Download a file"
method: GET
path: "/v1/files/{fileId}"
---

# Download a file

`GET /v1/files/{fileId}`

## Request

- Base URL: `https://api.payaion.com`
- URL: `https://api.payaion.com/v1/files/{fileId}`
- Auth: none required

Downloads and decrypts a **free** file by upload ID. Rate limited per IP.

A Private Link file is served as stored — the PAY1 ciphertext, with `Content-Type: application/octet-stream`, `Content-Length` equal to the stored size and `X-Payaion-Enc: e2ee` — because the gateway holds no key for it. Decrypt it with the key from the share link's fragment.

Priced and password-protected files are not served here: this endpoint has no way to take a payment or a password, so it returns `402 payment_required` for them. Fetch those through their share page at `/d/{shareHash}`, which runs the paywall or the password prompt and then streams the bytes.

## Path parameters

- `fileId` string, required

## Response `200`

File content streamed

## Other responses

- `402`: The file is priced or password-protected. Download it through its share page at `/d/{shareHash}` instead, which handles payment or the password.
- `404`: Resource not found
- `410`: File expired
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/payaion/apis/payaion-api.md) · [All operations](https://skmtc.dev/payaion/apis/payaion-api/llms.txt) · [OpenAPI document](https://skmtc.dev/payaion/apis/payaion-api/revisions/29927240cfc2?raw)
