Send Messages

Send Media

Sends a media file to a contact. The file must be accessible at a public URL. Available types: • image: Image (JPG, PNG, GIF, WebP). Supports a caption via text. • video: Video (MP4, AVI, MOV). Supports a caption via text. • audio: Audio as a file (MP3, OGG, WAV). Appears with an audio file icon. • ptt: Push-to-Talk: audio that appears as a voice message (microphone bubble). Ideal for humanizing automations. • myaudio: Native WhatsApp audio (OGG/Opus). Similar to ptt, use it when you already have the file in the correct format. • ptv: Video message (round video note). Always arrives in circular format; 16:9 video is cropped at the center. Ignores the caption (the text field does not appear). Use MP4 H.264. Accepts long durations (tested 15 to 180 s) and size within the media limit. • document: Document (PDF, DOCX, XLSX, etc.). Use docName to set the name displayed in the chat. • sticker: Animated or static sticker (WebP). Size limit (sending by URL): image, video, and audio up to ~190 MB; document up to ~500 MB. Above that, WhatsApp rejects it (HTTP 413 / upload error). Note: when sending the file as base64 in the request body through the public API (/api/v1), the limit drops to ~2 MB. Therefore, for larger files, always send by URL.

POSThttps://api.zapzapapi.com/api/v1/{instanceId}/send/media

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

Parameters

NameTypeInRequiredDescription
numbertextbodyYesNumber (with country code)
typeselectbodyYesMedia type
filetextbodyYesFile URL
texttextbodyNoCaption: images and videos
mentionstextbodyNoTag members (group only)
docNametextbodyNoFile name: required for document
delaynumberbodyNoDelay (ms)
digitandoselectbodyNoShows an automatic "typing..." indicator, proportional to the message length, before sending. On by default (humanizes and reduces block risk). Send false to turn it off and reply faster. The response remains synchronous.

Request example

curl

curl -X POST "https://api.zapzapapi.com/api/v1/{instanceId}/send/media" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"number":"5511999999999","type":"image","file":"https://..."}'

Node.js

const res = await fetch("https://api.zapzapapi.com/api/v1/{instanceId}/send/media", {
  method: "POST",
  headers: {
    "x-api-key": "YOUR_API_KEY",
    "x-api-secret": "YOUR_API_SECRET",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "number": "5511999999999",
    "type": "image",
    "file": "https://..."
  }),
});
console.log(await res.json());

Python

import requests

res = requests.post(
    "https://api.zapzapapi.com/api/v1/{instanceId}/send/media",
    headers={"x-api-key": "YOUR_API_KEY", "x-api-secret": "YOUR_API_SECRET"},
    json={"number":"5511999999999","type":"image","file":"https://..."},
)
print(res.json())

Response example

JSON

{
  "messageId": "ABCDEF123456",
  "status": "sent"
}

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.