Send Media Message
Send images, videos, documents, or audio files to your customers using direct URLs.
POST
/v1/messages/send-mediaRequest Body
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| phoneNumber | string | Yes | Recipient phone number in E.164 format. |
| mediaType | enum | Yes | One of: "image", "video", "audio", "document". Note: For image media messages, the format must be strictly JPEG or PNG. |
| mediaUrl | string | Yes | The direct public URL of the media file. For images, this must point to a valid JPEG or PNG file. |
| filename | string | No | Custom name for the file (recommended for documents to avoid "Untitled" display). |
| caption | string | No | Optional text to accompany the media. Supported for Images, Videos, and Documents. |
Image Format Requirement: When sending images (
mediaType: "image"), the image format must be strictly JPEG or PNG. Other formats (such as WEBP, GIF, or BMP) are not supported by the WhatsApp Cloud API and will cause delivery failure.Implementation Examples
const payload = {
phoneNumber: "+919876543210",
mediaType: "document",
mediaUrl: "https://wadoot.com/assets/report.pdf",
filename: "Sales_Report.pdf",
caption: "Check the latest report!"
};
await fetch('https://api.wadoot.com/v1/messages/send-media', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY_HERE'
},
body: JSON.stringify(payload)
});