---
title: "Download WhatsApp media"
method: GET
path: "/v1/whatsapp/media/{mediaId}"
tags: ["WhatsApp"]
---

# Download WhatsApp media

`GET /v1/whatsapp/media/{mediaId}`

## Request

- Base URL: `https://zernio.com/api`
- URL: `https://zernio.com/api/v1/whatsapp/media/{mediaId}`
- Auth: HTTP bearer

Streams the binary for a WhatsApp attachment. This is the endpoint the
`url` on a WhatsApp `attachments[]` entry points at, in both the
`message.received` webhook and the List messages response.

**This is an authenticated endpoint, not a public link.** Send
`Authorization: Bearer <your API key>` exactly as you would for any other
call. Passing the URL straight to a browser, an LLM vision API, or a
no-code "download file" step without the header returns `401`. This is
the most common integration mistake on this endpoint, and it differs from
Instagram, Facebook and Telegram, whose `attachments[].url` is a direct
CDN link that needs no header.

**Fetch on receipt, not lazily.** WhatsApp media lives in Meta's media
store, not ours, and it is removed after a limited retention window
(currently 7 days, and Meta has been dropping some inbound media sooner).
Once Meta drops it the media is unrecoverable and this endpoint answers
`400` permanently, so retrying will never succeed. Download and store the
bytes when the webhook arrives.

## Path parameters

- `mediaId` string, required

## Query parameters

- `accountId` string, required

## Response `200`

The media binary, streamed with its original content type.

## Other responses

- `400`: Media is no longer available on WhatsApp servers (expired or deleted by Meta). Permanent, do not retry.
- `401`: Missing or invalid API key. `code` is `missing_credentials` when no Authorization header was sent and `invalid_credentials` when the key is unknown, revoked or expired.
- `404`: Account not found, not accessible to the caller, or the media does not belong to it.
- `502`: Meta could not be reached or returned an unexpected error.

## Changes

- **2026-10-06** `f8c8f34fb41a`: 1 warning
  - added the new `account` enum value to the `details/budgetScope` response property for the response status `401`
- **2026-10-02** `d556591af3f6`: 7 info
  - added the optional property `code` to the response with the `401` status
  - added the optional property `details` to the response with the `401` status
  - added the optional property `docUrl` to the response with the `401` status
  - added the optional property `param` to the response with the `401` status
  - …3 more

[Operation history](https://skmtc.dev/zernio/apis/zernio-api/changes/v1/whatsapp/media/:mediaId/get.md)

---

[API](https://skmtc.dev/zernio/apis/zernio-api.md) · [All operations](https://skmtc.dev/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zernio/apis/zernio-api/revisions/4e74db179e73?raw)
