Send Media
Send images, videos, audio files, and documents to WhatsApp users. Media messages support captions and are delivered with rich previews in the chat.
Sends a media message (image, video, audio, or document) to a single recipient. The media file must be hosted at a publicly accessible URL. You can optionally include a caption with the media.
Media messages can only be sent within the 24-hour customer service window. To send media outside this window, use a template message with a media header via the Send Template endpoint.
Parameters
| Parameter | Type | Description |
|---|---|---|
| token required | string | Your API authentication token. |
| phone required | string | Recipient phone number with country code. E.g., +919876543210. |
| type required | string | Media type. Must be one of: image, video, audio, document. |
| media_url required | string | Publicly accessible URL of the media file. Must use HTTPS. WhatsApp will download the file from this URL. |
| caption optional | string | Caption text displayed below the media. Maximum 1024 characters. Not supported for audio messages. |
| filename optional | string | Custom filename for document messages. Displayed to the recipient as the download name. E.g., invoice-2025.pdf. |
Supported Media Types & Size Limits
| Type | Supported Formats | Max Size | Caption |
|---|---|---|---|
| image | JPEG, PNG | 5 MB | Yes |
| video | MP4, 3GPP | 16 MB | Yes |
| audio | MP3, AAC, OGG, AMR | 16 MB | No |
| document | PDF, DOC, DOCX, XLSX, PPTX, TXT, etc. | 100 MB | Yes |
Examples
1. Send Image with Caption
2. Send PDF Document
3. Send Video
Error Responses
Notes
Public URLs Required: Media URLs must be publicly accessible over HTTPS. WhatsApp servers download the file directly from your URL. URLs behind authentication, firewalls, or using HTTP (not HTTPS) will fail.
Audio Captions: The caption parameter is not supported for audio messages. If you include a caption with an audio file, it will be silently ignored.
Document Filenames: When sending documents, use the filename parameter to provide a human-readable filename. If omitted, the recipient will see the filename from the URL, which is often not user-friendly.
File Size Limits: WhatsApp enforces strict file size limits per media type. If your file exceeds the limit, the API will return an error. Compress or resize your media before sending if needed.
Best Practice: For images, use JPEG format for photos and PNG for graphics with transparency. Keep image dimensions reasonable (recommended: 800x800 to 1600x1600 pixels). Very large images will be compressed by WhatsApp, which may reduce quality.