---
title: "Download a WhatsApp file"
canonical: "https://bird.com/docs/api/reference/get-whatsapp-file-content"
---

# Download a WhatsApp file

`GET /v1/whatsapp/files/{file_id}/content`

Returns the bytes of a file stored for the workspace's WhatsApp messages, with its media type. The
`Content-Disposition` header carries its name. An unknown ID, an ID from another workspace, the ID of media
on a received message, a file WhatsApp refused at upload, or a file past its 30-day expiry returns `404`.

## Servers

- `https://{region}.platform.bird.com`: Regional API endpoint. Use the host for the region your organization is hosted in. Official Bird SDKs and the CLI select it automatically from your API key, so you rarely need to set it by hand.
  - `region`: `us1`, `eu1`. Default: `us1`. The region your organization's data is hosted in.

## Authentication

Use one authentication option:

- `BearerAuth`: HTTP bearer authentication. Pass the API key as a bearer token in the `Authorization` header. Workspace
keys use `bk_{region}_*`; organization master keys use `bm_{region}_*`.
The prefix identifies the region and selects the
API endpoint. Official Bird SDKs and the CLI derive the region from the key.

## Code samples

**TypeScript**

```ts
import { writeFile } from "node:fs/promises";

const content = await bird.whatsapp.files.download("waf_01kyb2m4xq7whs0d8n3prv6tez");
// Save it under a name you choose: the stored name may match a file you already have.
await writeFile("invoice-4821-copy.pdf", content.data, { mode: 0o600 });
console.log(content.contentType, content.data.length);
```

Examples: [TypeScript](/docs/api/reference/get-whatsapp-file-content.ts.md) · [Python](/docs/api/reference/get-whatsapp-file-content.py.md) · [Go](/docs/api/reference/get-whatsapp-file-content.go.md) · [PHP](/docs/api/reference/get-whatsapp-file-content.php.md) · [CLI](/docs/api/reference/get-whatsapp-file-content.cli.md) · [MCP](/docs/api/reference/get-whatsapp-file-content.mcp.md) · [cURL](/docs/api/reference/get-whatsapp-file-content.curl.md)

## Path parameters

- `file_id` (string, required): ID of the WhatsApp file.

## Header parameters

- `X-Workspace-Id` (string, optional): Workspace context for the request. Required for dashboard authentication and master keys. Workspace keys and access tokens already identify their workspace; send that workspace or omit the header. A different one is rejected.
- `X-Organization-Id` (string, optional): Organization context for the request. Required for dashboard authentication. An API key or access token carries its own organization, so send either that organization or no header at all; a different one is rejected.

## Related resources

- [Should I use a Bird SDK or call the API directly?](/explained/platform/should-i-use-an-sdk-or-call-the-api-directly) (answer)
- [Build your first integration](/learn/paths/integration) (course)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)

[Get an implementation brief](/learn/workspace?topic=api-basics)
