> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usertick.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Download files

> Download the files respondents sent with their answers through short lived download links.

Files that a respondent sends with an answer, such as uploads, screenshots and signatures, are listed in the response's `attachments`:

```json theme={null}
"attachments": [
  {
    "id": "c8f1e2d3-4a5b-4c6d-8e7f-9a0b1c2d3e4f.pdf",
    "questionId": "7d6c5b4a-0000-4a5b-8c9d-0e1f2a3b4c5d",
    "name": "invoice.pdf",
    "url": "https://app.usertick.com/api/public/v1/responses/9b1c2d3e-4f50-4a61-8b72-93a4b5c6d7e8/attachments/c8f1e2d3-4a5b-4c6d-8e7f-9a0b1c2d3e4f.pdf"
  }
]
```

`url` is an API address, so it needs a credential like any other call. A credential with `responses:read` gets a `302` redirect to a download link that works for **5 minutes**:

```bash theme={null}
curl -L "https://app.usertick.com/api/public/v1/responses/9b1c2d3e-4f50-4a61-8b72-93a4b5c6d7e8/attachments/c8f1e2d3-4a5b-4c6d-8e7f-9a0b1c2d3e4f.pdf" \
  -H "Authorization: Bearer utk_live_your_key_here" \
  -o invoice.pdf
```

`-L` makes curl follow the redirect, and most HTTP clients follow it on their own. Some clients drop the `Authorization` header when they follow it, which doesn't matter because the download link carries its own short lived signature.

Because the download link stops working after 5 minutes, request a new link each time you need the file instead of storing it.

| Status and code | Meaning |
| - | - |
| `302` | The download link is in the `Location` header. |
| `404` `RSP-002-007` | The response doesn't exist or is older than your plan's retention window. |
| `404` `PUB-003-006` | The response has no file with that id. |
| `503` `MED-003-503` | File storage isn't available. Try again later. |

[Erasing a response](https://docs.usertick.com/developers/api/erasure.md) also deletes its files.

See [Download a respondent's file](https://docs.usertick.com/developers/api/reference/get-attachment.md) in the API reference.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.