# Get a document's download link

> Returns a signed link, valid for 5 minutes, that downloads the file under its name (an n8n HTTP Request node can fetch it as binary).

`GET /v1/documents/{documentId}/download`

Returns a signed link, valid for 5 minutes, that downloads the file under its name (an n8n HTTP Request node can fetch it as binary). A `pending` document is a 409 `upload_incomplete`.

**Permissions:** `documents:read` · **Kind:** read · **Cost:** 1 unit



## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `documentId` | uuid | yes |  |

## Query parameters

_None._

## Response `200`

| Field | Type | Required | Description |
|---|---|---|---|
| `object` | "document_download" | yes |  |
| `documentId` | uuid | yes |  |
| `name` | string | yes |  |
| `mimeType` | string | yes |  |
| `byteSize` | integer | yes | ≥ 0 |
| `url` | uri | yes | A signed link that downloads the file as `name`. |
| `expiresAt` | string | yes |  |

## Errors

Errors are [problem details](https://api.bymundi.com/docs/guides/errors.md). Besides the refusals described above, any call like this one can return:

- [`invalid_request`](https://api.bymundi.com/problems/invalid_request.md) — Invalid request
- [`unauthorized`](https://api.bymundi.com/problems/unauthorized.md) — Missing or invalid API key
- [`insufficient_scope`](https://api.bymundi.com/problems/insufficient_scope.md) — Missing permission
- [`rate_limited`](https://api.bymundi.com/problems/rate_limited.md) — Rate limit reached
- [`not_found`](https://api.bymundi.com/problems/not_found.md) — Not found

## Examples

#### curl

```bash
curl https://api.bymundi.com/v1/documents/$DOCUMENT_ID/download \
  -H "Authorization: Bearer $BYMUNDI_KEY"
```

#### JavaScript

```javascript
const res = await fetch(`https://api.bymundi.com/v1/documents/${documentId}/download`, {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.BYMUNDI_KEY}`,
  },
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();
```

#### Python

```python
import os, uuid, requests

res = requests.get(
    f"https://api.bymundi.com/v1/documents/{documentId}/download",
    headers={"Authorization": f"Bearer {os.environ['BYMUNDI_KEY']}"},
)
res.raise_for_status()
data = res.json()
```
