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
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
The recipient’s WhatsApp number in international format (without + symbol)Example:
5511999999999 for a Brazilian numberThe type of media being sentOptions:
image, document, video, audioThe 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...
The filename for the media (required for base64 documents)Example:
document.pdfA caption or description for the media
The MIME type of the media fileExamples:
image/jpeg, video/mp4, application/pdfDelay before sending the message in millisecondsExample:
1000 for 1 second delayQuote a previous message by providing its key and message object
Mention all participants in a groupDefault:
falseArray of phone numbers to mention. Each number should be a numeric string.Example:
["5511999999999", "5511888888888"]Response
Message key information
The sent message object containing the media and metadata
Unix timestamp when the message was sent
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
HTTP status code
Error description
Common Errors
| Status Code | Error Message | Solution |
|---|---|---|
| 400 | ”Owned media must be a url or base64” | Provide valid URL or base64 string |
| 400 | ”For base64 the file name must be informed” | Add fileName when sending base64 documents |
| 401 | Unauthorized | Check your API key |
| 404 | Not Found | Verify instance exists and is connected |
| 500 | Internal Server Error | Check server logs or contact support |