API Reference v1.0

Supported Media Types

Reference guide for all media formats supported by the WhatsApp Business API, including file size limits, format requirements, and best practices for media delivery.

Media Type Reference

The following table lists every media type supported by the WhatsApp Business API, along with accepted formats and size constraints.

Type Supported Formats Max Size Notes
Image JPEG, PNG 5 MB Must be 8-bit, RGB or RGBA color space. Animated GIFs are not supported as images.
Video MP4, 3GPP 16 MB H.264 video codec and AAC audio codec required. Only MP4 with H.264 is broadly supported.
Audio AAC, MP4, MPEG, AMR, OGG (Opus codecs only) 16 MB Captions are not supported for audio messages. OGG files must use Opus codec.
Document PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, TXT 100 MB Always include the filename parameter with the correct file extension for proper display.
Sticker (static) WebP 100 KB Must be exactly 512 × 512 pixels with a transparent background.
Sticker (animated) WebP 500 KB Must be exactly 512 × 512 pixels with a transparent background.

File size matters. Messages with media that exceeds the size limit will be rejected by the API. Always validate file sizes before sending, especially for user-uploaded content.

Media URL Requirements

When sending media via URL, the WhatsApp servers download the file from the provided link. Your URLs must meet the following requirements:

Avoid short-lived URLs. If you use pre-signed URLs (e.g., from AWS S3 or Google Cloud Storage), set the expiration to at least 15 minutes. URLs that expire too quickly may result in failed media downloads.

Sending Media Messages

To send a media message, include the media URL and type in your API request. Below are examples for the most common media types.

Image Message

Request Body
{ "token": "YOUR_API_TOKEN", "phone": "+919876543210", "type": "image", "media_url": "https://example.com/images/product-photo.jpg", "caption": "Check out our new product!" }

Document Message

Request Body
{ "token": "YOUR_API_TOKEN", "phone": "+919876543210", "type": "document", "media_url": "https://example.com/files/invoice-2024.pdf", "filename": "invoice-2024.pdf", "caption": "Here is your invoice for January 2024." }

Video Message

Request Body
{ "token": "YOUR_API_TOKEN", "phone": "+919876543210", "type": "video", "media_url": "https://example.com/videos/tutorial.mp4", "caption": "Watch our quick setup tutorial." }

Audio Message

Request Body
{ "token": "YOUR_API_TOKEN", "phone": "+919876543210", "type": "audio", "media_url": "https://example.com/audio/voicenote.ogg" }

Audio has no caption support. Unlike images, videos, and documents, audio messages do not support the caption parameter. If you need to include a description, send it as a separate text message.

Media Parameters

Parameter Type Description
type required string The media type. One of: image, video, audio, document, sticker.
media_url required string A publicly accessible URL pointing to the media file. Must return the correct Content-Type header.
caption optional string Caption text displayed below the media. Supported for image, video, and document types. Not supported for audio or sticker.
filename optional string The filename displayed to the recipient. Required for documents to ensure the correct file extension is shown (e.g., report.pdf).

Tips & Best Practices

Optimization tip: For images, resize to a maximum of 1600 × 1600 pixels before sending. Larger images are automatically resized by WhatsApp, which may result in unexpected cropping or quality reduction.

Common Media Errors

Error Cause Solution
Media download failed URL is not publicly accessible or has expired. Ensure the URL is accessible without authentication and has a long expiration time.
Unsupported media type File format is not in the supported list. Convert the file to a supported format before sending (e.g., convert BMP to JPEG).
File too large File exceeds the maximum size for its media type. Compress or resize the file to meet the size limit shown in the reference table above.
Invalid Content-Type The hosting server returns an incorrect or missing Content-Type header. Configure your server or CDN to return the correct MIME type for the file.

Related: For a full list of API error codes and troubleshooting guidance, see the Error Codes Reference.