---
title: "Download File"
source_url: https://docs.rapyd.net/en/download-file.html
lang: en
---

# Download File

Download a communication thread attachment as raw binary data. To download the data, first retrieve the communication thread messages using [Get Case Communication Thread](https://docs.rapyd.net/en/get-case-communication-thread.md "Get Case Communication Thread"). Each message includes an `attachments` array. Copy the `file_id` value of the attachment that you want to download and use it in the request.

> **Important:**
>
> Wait for the response of a download request before initiating the next download request. Do not run download requests concurrently.

### Parameters

### Request Path Parameters

- - file_id (string, required)
  - The identifier of the attachment to download. Obtain it from the `attachments` array of a message. See also response in [Get Case Communication Thread](https://docs.rapyd.net/en/get-case-communication-thread.md "Get Case Communication Thread").

  - thread_token (string, required)
  - The unique token of the communication thread. String starting with **comm_** . Appears in the response of [Get All Case Communication Threads](https://docs.rapyd.net/en/get-all-case-communication-threads.md "Get All Case Communication Threads").

### Request Header Parameters

- - access_key (string, required)
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type (string, required)
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - salt (string, required)
  - Random string. Recommended length: 8-16 characters.
- - signature (string, required)
  - Signature calculated for each request individually.

    See [Request Signatures](https://docs.rapyd.net/en/request-signatures.md "Request Signatures").
- - timestamp (string, required)
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### 200 Response

The response body includes the raw binary file data of the file and the following parameters

- - Content-Type (string)
  - The actual file type (pdf, png, jpg, csv, etc.). For example, **application/pdf**.

- - Content-Type (string)
  - The original file name. For example, **attachment; filename="invoice_july_2026.pdf"**

- v1/threads/:thread_token/attachment/:file_id/download

- Download File
- ```curl
  curl -X GET
  'https://api.rapyd.net/v1/threads/comm_5eda2b2651d2a9bda22845aff027ca53/attachment/a8dd8e36-d8bb-4a6f-9431-699e6f11952d/download' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here'
  ```
- ```json
  HTTP/1.1 200 OK
  Content-Type: application/pdf
  Content-Disposition: attachment; filename="invoice_july_2026.pdf"

  [binary file data]
  ```
