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.
POST
https://api.zapzapapi.com/api/v1/{instanceId}/message/downloadAuthentication with the x-api-key and x-api-secret headers.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
id | text | body | Yes | Message ID |
return_link | select | body | No | Return public file URL |
return_base64 | select | body | No | Return file as base64 |
generate_mp3 | select | body | No | For audio: return as MP3 (false = OGG) |
transcribe | select | body | No | Transcribe 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.
Other endpoints in this category
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.
