---
title: "download media from message"
method: POST
path: "/instances/{id}/client/action/download-media"
tags: ["message"]
---

# download media from message

`POST /instances/{id}/client/action/download-media`

## Request

- Base URL: `https://waapi.app/api/v1`
- URL: `https://waapi.app/api/v1/instances/{id}/client/action/download-media`
- Auth: HTTP bearer

Downloads the media content from a message and returns a temporary download URL valid for 15 minutes. Use this instead of get-message-by-id with includeMedia when you only need the media file.

## Path parameters

- `id` integer, required

## Request body

- object
  - `messageId` string, required: Serialized message ID in format: <fromMe>_<chatId>_<messageHash>

## Response `200`

Request reached the instance. `data.status` reports whether the action was carried out; on error `data` carries `message` and `explanation`. Payload: Media download URL generated.

- object
  - `status` 'success' | 'error': Whether the request reached the instance. `success` here does **not** mean the action was carried out — that is reported by `data.status`, which is the authoritative one. A malformed input arrives as `status: success` with `data.status: error`.
  - `data` union: The action's outcome. `status: success` carries the payload; `status: error` is an `actionError`.
    - object
      - `status` 'success', required: Whether the instance carried the action out — the authoritative field. In this branch it is always `success`; when the instance refused the action the whole `data` object is an `actionError` with `status: error`, `message` and `explanation`.
      - `instanceId` union
        - integer
        - string
      - `data` object
        - `message` object: The message object
        - `media` object
          - `url` string: Temporary signed download URL (valid 15 minutes)
          - `mimetype` string
          - `filename` string, nullable
          - `filesize` integer, nullable
    - ActionError: Shape of `data` when the instance refused the action. HTTP status is still 200 and the outer `status` is still `success`.
      - `status` 'error', required
      - `message` string
      - `explanation` string
      - `instanceId` union
        - integer
        - string

---

[API](https://skmtc.dev/waapi/apis/waapi-api-2.md) · [All operations](https://skmtc.dev/waapi/apis/waapi-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/waapi/apis/waapi-api-2/revisions/490302f75576?raw)
