01 · Definition
What is a media message?
A media message is a WhatsApp Business API message whose payload is a file rather than text. The WhatsApp Cloud API recognises five media kinds: image, video, audio, document and sticker. A product photo, an unboxing clip, a recorded reminder, a PDF invoice and a brand sticker all travel the same way: the customer's WhatsApp downloads the file and renders it inside the chat, with a thumbnail, player or file card as the type demands.
Every media send to /{PHONE_NUMBER_ID}/messages follows one pattern. You set type to the media kind and add an object with the same name, such as "document": { ... }. That object points at the file in one of two ways: id, a Media ID returned by Media Upload, or link, a public HTTPS URL that WhatsApp fetches at send time. Images, videos and documents can carry an optional caption; documents can also carry a filename that the customer sees on the file card. Audio and stickers take no caption.
This page is the overview of the family. The exact formats and size ceilings for each kind (5 MB images, 16 MB video and audio, 100 MB documents, small WebP stickers) live on Media File Limits, and each kind has its own page, such as Image Message, Document Message and Voice Note. Media also appears in a Template Header, which is a different thing: a free-form media message can go out only inside the 24-hour customer service window, while a template with a media header can open a conversation.
Media flows in the other direction too. When a customer sends a photo, voice note or PDF, your messages webhook receives an object of the same type holding a media id, mime_type, sha256 and any caption, never the file itself. Media Retrieval exchanges that ID for a short-lived download URL. The send response, in both cases, is a WAMID: proof the request was accepted, not that the file was delivered.
Key takeaways
- A media message is a WhatsApp message that carries a file: an image, video, audio clip, document or sticker, instead of plain text.
- Every media send uses the same shape:
typenames the kind, and an object of the same name holds anidor alink. - Images, videos and documents take an optional
caption; audio and stickers do not, and documents also accept afilename. - Uploaded media IDs last 30 days and can be reused; media IDs received in webhooks can be downloaded for 7 days.
- Meta bills the message by category, not by file: a media message costs the same as text of the same category.
02How does InfiQ help with a media message?
Send any media type from InfiQ's inbox, broadcasts and bots. Through InfiQ's API, the body is the one Meta documents, with a public link to the file.
InfiQ API reference03 · Code samples
A media message in code
curl -X POST "https://api.infiq.in/v1/messages" \-H "X-INFIQ-API-KEY: {INFIQ_API_KEY}" \-H "Content-Type: application/json" \-d '{"messaging_product": "whatsapp","recipient_type": "individual","to": "919812345678","type": "document","document": {"id": "{MEDIA_ID}","filename": "INV-30418.pdf","caption": "Your invoice INV-30418, due 25 Oct"}}'
Swap `document` for `image`, `video`, `audio` or `sticker` in both places; drop `caption` for audio and stickers.
04Playground
A working model of Media Message. Use its controls to replay it step by step.
Walk through one shape that sends every media type
const type = "document"; // image | video | audio | document | stickerconst res = await fetch( "https://api.infiq.in/v1/messages", { method: "POST", headers: { "X-INFIQ-API-KEY": process.env.INFIQ_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ messaging_product: "whatsapp", to: "919812345678", type, [type]: { link: "https://files.example.in/invoices/INV-30418.pdf", filename: "INV-30418.pdf", caption: "Your invoice INV-30418, due 25 Oct", }, }), },);const { messages } = await res.json(); // messages[0].id is the WAMIDStep 6 of 6 · line 22
The response WAMID means accepted, not delivered. Watch the status webhooks for delivered, read or failed.
send-media.js, step 6 of 6, line 22: The response WAMID means accepted, not delivered. Watch the status webhooks for delivered, read or failed.
05 · Specifications
A media message: key facts and limits
| Media types | image, video, audio, document, sticker |
|---|---|
| File reference | id (uploaded Media ID) or link (public HTTPS URL) |
| Caption | image, video, document; not audio or sticker |
| Size ceilings | Image 5 MB · video and audio 16 MB · document 100 MB |
| Sticker | WebP, 100 KB static / 500 KB animated |
| Uploaded Media ID | Valid 30 days, reusable |
| Inbound media ID | Downloadable for 7 days; download URL lasts 5 minutes |
| Billing | Per delivered message by category; no file surcharge |
06 · Operation
How does a media message work?
Pick the media type for the job
Photos and graphics as
image, motion asvideo, recordings asaudio, anything that must stay sharp or be saved (invoices, tickets, statements) asdocument, expressive brand art assticker. Check the file against Media File Limits before you send.Upload the file or host it
Media Upload (
POST /{PHONE_NUMBER_ID}/media) returns a Media ID valid for 30 days that you can reuse across sends. Or host the file at a public HTTPS URL that returns the correctContent-Typeand pass it aslink.Send with the type-named object
POST to
/messageswithtypeset to the kind and an object of the same name holdingidorlink, pluscaption(image, video, document) orfilename(document) where useful.Track delivery through status webhooks
Store the WAMID from the response, then follow
sent,delivered,readorfailedstatuses. A failed media send usually carries an error that points at the file: the link could not be fetched, or the type or size was rejected.Handle inbound media promptly
For each inbound media object, queue a job that calls Media Retrieval with the
id, downloads within 5 minutes of getting the URL, checks thesha256and stores the file in your own storage.
07 · Cautions
Common mistakes with a media message
Mismatching `type` and the object name
Setting
"type": "video"but sending animageobject fails validation. Build the payload from one variable, as in{ type, [type]: { id } }, so the two can never drift apart.Adding a caption to audio or stickers
Audio and stickers take no
caption. If the message needs words, send a short Text Message before or after the clip, or use a document or video instead.Links WhatsApp cannot fetch
A URL behind a login, on a slow server, with raw spaces or returning
text/htmlbreaks alinksend. Percent-encode the path and serve the rightContent-Type, or upload once and send byid.Sending free-form media to a cold contact
A media message outside an open 24-hour window is rejected with a re-engagement error. To open with a picture, video or PDF, use an approved template with a media header.
Leaving inbound media in the webhook log
Inbound media IDs stop working after 7 days, and the URL from Media Retrieval after 5 minutes. Download from a queue worker soon after the webhook and keep your own copy.
08 · Worked example: One send function for a Pune electronics retailer
Example: One send function for a Pune electronics retailer
A Pune electronics retailer replies to customers from a shared inbox. Its backend has one sendMedia(type, ref, extras) function: when a customer asks for the bill, the agent sends a document with the uploaded invoice ID, filename INV-30418.pdf and a caption with the due date; when someone asks how to wall-mount a TV, it sends a 40-second video (about 6 MB, illustrative) uploaded once and reused for weeks. A customer replies with a video of a cracked screen; the webhook delivers a video object with an id, a worker downloads it within seconds and attaches it to the warranty ticket. Festive offers, by contrast, go out as marketing templates with an image header, because those customers have not messaged in the last 24 hours.
09 · Rationale
Why does a media message matter?
Most real customer conversations in India are not text-only. A buyer wants to see the kurta in the actual colour, a patient sends a prescription photo, a courier needs proof of delivery, an accounts team needs the invoice PDF. Understanding the shared media shape means one sending function covers all five types, and knowing the difference between a session media message and a template header decides whether your file can be sent at all.
10 · Questions and answers
Media Message FAQs
- What types of media can I send through the WhatsApp Business API?
- Five: image, video, audio, document and sticker. Each has its own formats and size ceiling, from 5 MB for images to 100 MB for documents, listed on the media file limits page. Location and contacts are separate message types, not media.
- Should I send WhatsApp media by media ID or by link?
- By media ID where you can. Uploading once gives an ID valid for 30 days that you can reuse, and WhatsApp does not need to fetch your server at send time. A
linkworks but must be public, fast and correctly encoded. - Does a media message cost more than a text message?
- No. Meta charges per delivered message by category, not by file size. A media reply in an open window is a service message, charged at ₹0.145 in India since 1 October 2026; a template with a media header costs that template's category rate.
- Can I send a media message to a customer who has not messaged me?
- Not as a free-form media message. Outside the 24-hour customer service window you must send an approved template; give it an image, video or document header if the file is the point of the message.
- How do I receive images and files customers send on WhatsApp?
- They arrive in your messages webhook as a media ID, not as the file. Call the media endpoint with that ID to get a download URL, fetch it with your access token within 5 minutes, verify the
sha256and store it.
11 · Recommended practice
Best practices for a media message
- Reuse one uploaded Media ID for a file many customers receive instead of uploading it per recipient.
- Put the searchable fact (order number, amount due, item code) in the caption, not only inside the file.
- Always set
filenameon documents; otherwise the customer may see a generic name. - Check the real file type from its bytes, not its extension, before sending a customer's upload onwards.
* Per-message rates for India, ex-GST: marketing, utility and authentication effective 1 July 2026; service messages ₹0.145 since 1 October 2026 after the first 1,000 a month on each WhatsApp number, which are free (all were ₹0 until 30 September 2026). Volume commitments earn discounts — final rate is confirmed on your account; applicable GST extra. Rates for other countries differ (see the international rate table on /pricing).