Skip to content
InfiQ glossary · Reference sheetMessages & interactivity

Media Message

A WhatsApp message whose content is a file (image, video, audio, document or sticker) sent by media ID or link, with an optional caption on most types.

Properties

Term
Media Message
Abbreviation
None
Level
Foundation
Audience
Developers
Reviewed
Also called
WhatsApp media · Attachment message · Rich media message · File message

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: type names the kind, and an object of the same name holds an id or a link.
  • Images, videos and documents take an optional caption; audio and stickers do not, and documents also accept a filename.
  • 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.

See InfiQ pricing

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 reference

03 · 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

6 / 6
const type = "document"; // image | video | audio | document | sticker
const 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 WAMID

Step 6 of 6 · line 22

The response WAMID means accepted, not delivered. Watch the status webhooks for delivered, read or failed.

Jump to
Step through a Node send, a link-based audio send and an inbound media webhook. Each highlight shows the field that matters and why; switch tabs to compare outbound and inbound media.

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 typesimage, video, audio, document, sticker
File referenceid (uploaded Media ID) or link (public HTTPS URL)
Captionimage, video, document; not audio or sticker
Size ceilingsImage 5 MB · video and audio 16 MB · document 100 MB
StickerWebP, 100 KB static / 500 KB animated
Uploaded Media IDValid 30 days, reusable
Inbound media IDDownloadable for 7 days; download URL lasts 5 minutes
BillingPer delivered message by category; no file surcharge

06 · Operation

How does a media message work?

  1. Pick the media type for the job

    Photos and graphics as image, motion as video, recordings as audio, anything that must stay sharp or be saved (invoices, tickets, statements) as document, expressive brand art as sticker. Check the file against Media File Limits before you send.

  2. 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 correct Content-Type and pass it as link.

  3. Send with the type-named object

    POST to /messages with type set to the kind and an object of the same name holding id or link, plus caption (image, video, document) or filename (document) where useful.

  4. Track delivery through status webhooks

    Store the WAMID from the response, then follow sent, delivered, read or failed statuses. 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.

  5. 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 the sha256 and 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 an image object 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/html breaks a link send. Percent-encode the path and serve the right Content-Type, or upload once and send by id.

  • 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 link works 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 sha256 and 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 filename on 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).

Put Media Message to work

InfiQ is an official Meta Business Partner. Start a 7-day free trial — no card needed — and see this running on your own number.