Conversations

Download Media

Downloads received media (image, video, audio, document) from the message ID. The `id` field must come from the webhook or the `/message/find` endpoint. Note: the transcribe parameter is best-effort and may not return the transcription. For guaranteed audio transcription, use the AI module.

POSThttps://api.zapzapapi.com/api/v1/{instanceId}/message/download

Authentication with the x-api-key and x-api-secret headers.

Parameters

NameTypeInRequiredDescription
idtextbodyYesMessage ID
return_linkselectbodyNoReturn public file URL
return_base64selectbodyNoReturn file as base64
generate_mp3selectbodyNoFor audio: return as MP3 (false = OGG)
transcribeselectbodyNoTranscribe audio (best-effort: may not return text)

Request example

curl

curl -X POST "https://api.zapzapapi.com/api/v1/{instanceId}/message/download" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"id":"7EB0F01D7244B421048F0706368376E0"}'

Node.js

const res = await fetch("https://api.zapzapapi.com/api/v1/{instanceId}/message/download", {
  method: "POST",
  headers: {
    "x-api-key": "YOUR_API_KEY",
    "x-api-secret": "YOUR_API_SECRET",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "id": "7EB0F01D7244B421048F0706368376E0"
  }),
});
console.log(await res.json());

Python

import requests

res = requests.post(
    "https://api.zapzapapi.com/api/v1/{instanceId}/message/download",
    headers={"x-api-key": "YOUR_API_KEY", "x-api-secret": "YOUR_API_SECRET"},
    json={"id":"7EB0F01D7244B421048F0706368376E0"},
)
print(res.json())

Response example

JSON

{
  "fileURL": "https://server.example.com/files/abc123.jpg",
  "mimetype": "image/jpeg"
}

Values are illustrative; the fields follow the real response format.

See the full reference

Get your API keys

Create your account, connect a number in minutes and start using the API. R$15 per active number/month, with a welcome credit when you create the account, subject to the current campaign.