Send Media Message

Send images, videos, documents, or audio files to your customers using direct URLs.

POST/v1/messages/send-media

Request Body

Parameters

ParameterTypeRequiredDescription
phoneNumberstringYesRecipient phone number in E.164 format.
mediaTypeenumYesOne of: "image", "video", "audio", "document". Note: For image media messages, the format must be strictly JPEG or PNG.
mediaUrlstringYesThe direct public URL of the media file. For images, this must point to a valid JPEG or PNG file.
filenamestringNoCustom name for the file (recommended for documents to avoid "Untitled" display).
captionstringNoOptional 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)
});