Skip to main content

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:
  1. URL: Provide a direct link to the media file
  2. Base64: Provide the base64-encoded media content
  3. File Upload: Use multipart/form-data to upload a file
string
required
The recipient’s WhatsApp number in international format (without + symbol)Example: 5511999999999 for a Brazilian number
string
required
The type of media being sentOptions: image, document, video, audio
string
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.pdf
string
A caption or description for the media
string
The MIME type of the media fileExamples: image/jpeg, video/mp4, application/pdf
integer
Delay before sending the message in millisecondsExample: 1000 for 1 second delay
object
Quote a previous message by providing its key and message object
boolean
Mention all participants in a groupDefault: false
array
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

When sending base64-encoded documents, you must provide the fileName parameter.

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

Ensure the media URL is publicly accessible or the base64 string is properly formatted. Invalid media will result in a 400 Bad Request error.
number
HTTP status code
string
Error description

Common Errors