Send Media Message
Send media files including images, videos, documents, and audio to WhatsApp contacts or groups. You can send media via URL, base64, or file upload.Endpoint
Path Parameters
string
required
The name of your WhatsApp instance that you created
Request Body
This endpoint supports three methods for sending media:
- URL: Provide a direct link to the media file
- Base64: Provide the base64-encoded media content
- File Upload: Use
multipart/form-datato upload a file
string
required
The recipient’s WhatsApp number in international format (without + symbol)Example:
5511999999999 for a Brazilian numberstring
required
The type of media being sentOptions:
image, document, video, audiostring
required
The media content as a URL or base64 string (not required when using file upload)Examples:
- URL:
https://example.com/image.jpg - Base64:
data:image/jpeg;base64,/9j/4AAQSkZJRg...
string
The filename for the media (required for base64 documents)Example:
document.pdfstring
A caption or description for the media
string
The MIME type of the media fileExamples:
image/jpeg, video/mp4, application/pdfinteger
Delay before sending the message in millisecondsExample:
1000 for 1 second delayobject
Quote a previous message by providing its key and message object
boolean
Mention all participants in a groupDefault:
falsearray
Array of phone numbers to mention. Each number should be a numeric string.Example:
["5511999999999", "5511888888888"]Response
object
Message key information
object
The sent message object containing the media and metadata
string
Unix timestamp when the message was sent
string
Message status (e.g., “PENDING”, “SENT”)
Code Examples
Advanced Examples
Send image with URL
Send image with URL
Send PDF document with base64
Send PDF document with base64
Send video with mentions
Send video with mentions
Media Type Guidelines
Image
- Supported formats: JPG, PNG, GIF, WEBP
- Recommended size: Under 5MB
- MIME types:
image/jpeg,image/png,image/gif,image/webp
Video
- Supported formats: MP4, 3GP, AVI, MOV
- Recommended size: Under 16MB
- MIME types:
video/mp4,video/3gpp,video/avi,video/quicktime
Document
- Supported formats: PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT, ZIP
- Recommended size: Under 100MB
- MIME types:
application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document
Audio
- Supported formats: MP3, OGG, WAV, AAC
- Recommended size: Under 16MB
- MIME types:
audio/mpeg,audio/ogg,audio/wav,audio/aac
For audio messages that should appear as voice notes (PTT), use the Send Audio endpoint instead.
Error Responses
number
HTTP status code
string
Error description