Images can be sent either by uploading a file or providing a URL. The API supports compression and view-once ephemeral images.
Endpoint
Headers
Device identifier for multi-device support. Required when multiple devices are registered.
Must be
multipart/form-data for file uploads.Request Body (multipart/form-data)
Phone number with country code and WhatsApp suffix.Format:
{country_code}{phone_number}@s.whatsapp.netExample: [email protected]Optional caption text for the image. Supports up to 3000 characters.Example:
"Beautiful sunset at the beach"Image file to upload. Supports common image formats (JPEG, PNG, GIF, WebP).
Either
image (file upload) or image_url must be provided, but not both.URL of the image to send. The API will download and send the image from this URL.Example:
"https://example.com/image.jpg"Either
image (file upload) or image_url must be provided, but not both.Enable view-once mode. When enabled, the image can only be viewed once by the recipient and will disappear after being opened.
Compress the image before sending to reduce file size and improve delivery speed. Useful for large images.
Disappearing message duration in seconds.Common values:
86400- 24 hours604800- 7 days7776000- 90 days
Mark the message as forwarded.
Response
Response status code. Returns
"SUCCESS" on successful send.Human-readable response message.
Code Examples
Response Example
Features
View Once Images
View-once images provide enhanced privacy by allowing recipients to view the image only once:Image Compression
Enable compression to reduce file size while maintaining acceptable quality:- Large image files (>5MB)
- Reducing bandwidth usage
- Faster delivery times
- Recipients with slower connections
URL-Based Image Sending
Send images directly from URLs without downloading them first:- E-commerce integrations
- Content management systems
- Automated image sharing from cloud storage
Image Requirements
Supported Formats
- JPEG (.jpg, .jpeg)
- PNG (.png)
- GIF (.gif)
- WebP (.webp)
File Size Limits
- Maximum file size: 16MB (uncompressed)
- Recommended: Under 5MB for optimal delivery
- Use compression for larger files
Image Dimensions
- Minimum: 48x48 pixels
- Maximum: 16000x16000 pixels
- Recommended aspect ratio: 4:5 or 1:1 for best display
Best Practices
- Choose the Right Method: Use file upload for local images, URL method for images already hosted online.
- Optimize Before Upload: Pre-optimize images before sending to reduce processing time and bandwidth.
- Use Compression Wisely: Enable compression for large files, but avoid it for images that need to preserve quality (screenshots, text images).
- Caption Length: Keep captions concise. While WhatsApp supports up to 3000 characters, shorter captions provide better UX.
- View Once for Sensitive Content: Use view-once mode for confidential or time-sensitive images.
- Error Handling: Implement retry logic for failed uploads, especially when using URL-based sending.
Error Responses
Common causes:
- Invalid phone number format
- Missing both
imageandimage_url - Providing both
imageandimage_url - Invalid image format
- File too large
Common causes:
- Device not connected
- Failed to download image from URL
- Image processing error
- Network connectivity issues
Related Endpoints
- Send Video - Send video messages
- Send File - Send document files
- Send Text - Send text messages
- Download Media - Download media from messages
