# Download a delivered file

`GET https://api.parasend.com/v1/deliveries/{id}/files/{fileId}/content`

Source: https://parasend.com/docs/api/deliveries/download-file

Authentication: `Authorization: Bearer <API key>` (a `ps_test_` key in test mode, `ps_live_` in live mode).

Requires the `documents.read` permission. **Every call emits
`document.previewed` into the delivery's audit trail, attributed to the acting
key/user. No exceptions, no quiet mode.** This is the privacy-gated document
preview behind the portal's reveal step.

## Path parameters

- `id` (string, required): The delivery's ID, starting `dlv_`.
- `fileId` (string, required)

## Example: Download a delivered file

```bash
curl "https://api.parasend.com/v1/deliveries/dlv_01M6R27T05512SCV3852TPM2XY/files/fil_01M6R27SZK99V6N6WG4GK15T6R/content" \
  -H "Authorization: Bearer $PARASEND_KEY"
```

```js
const res = await fetch('https://api.parasend.com/v1/deliveries/dlv_01M6R27T05512SCV3852TPM2XY/files/fil_01M6R27SZK99V6N6WG4GK15T6R/content', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.PARASEND_KEY}`,
  },
});
const data = await res.json();
```

## Response 200

File bytes.

Content type: application/octet-stream.

Errors: one shape, `{"error": {type, code, message, param, request_id}}`; every code is listed at https://parasend.com/docs/errors.
