POST /v1/messages/send. There is no separate media endpoint — media is one of the three mutually exclusive send modes:
- Template send —
templateId(+ optionalmediaoverride) - Free-form text send —
text - Direct media send —
media+mediaType, notemplateIdand notext
Sending media requires an active paid subscription. Without one the API returns
402 with code SUBSCRIPTION_REQUIRED_FOR_MEDIA.Direct media send
Providemedia + mediaType without templateId or text. In this mode buttons, header, footer, and variables are not allowed. An optional caption is allowed for image, video, and document — but not for audio.
media and mediaType fields
media— a public http(s) URL or a base64 data URI (data:<mime>;base64,...).mediaType—image,video,document, oraudio. Set it explicitly when the URL extension is not obvious (e.g. a PDF whose URL does not end in.pdf).
Base64 vs. URL per provider
| Provider | Public URL | Base64 data URI |
|---|---|---|
| Meta Cloud API | ✓ | ✓ |
| Evolution v2 | ✓ | ✓ |
| Evolution GO | ✓ | ✗ — URL only |
Audio is a voice note (PTT)
WhenmediaType is audio, the file is delivered as a WhatsApp voice note (PTT) on all providers. On Evolution v2 and Evolution GO the recipient briefly sees a “recording audio” presence indicator before delivery; Meta Cloud API has no outbound presence API, so no indicator appears on Meta sends.
Media with templates
Addmedia (+ mediaType) to a template send to attach or override media — it takes precedence over any media URL embedded in the template:
media/mediaType cannot be combined with a free-form text send, and buttons are incompatible with mediaType: "video" or "document" (WhatsApp does not support buttons on video/PDF messages).