Learn how to send image messages to customers via WhatsApp Business API. Includes format requirements, size limits, code examples, and best practices for delivering visual content.
Overview
This guide explains how to send image files to your customers via WhatsApp Business API. Images are a powerful way to share visual information like product photos, receipts, infographics, or promotional content.
Who this is for: Developers integrating WhatsApp messaging capabilities into their applications.
What you'll learn: How to format and send image messages, including format requirements, size limits, and messaging restrictions.
Before You Start
API Token RequiredYou need a valid API authentication token to use this endpoint. Learn how to obtain your token in the WhatsApp Business API authentication guide.
Understanding the 24-Hour Messaging Window
WhatsApp enforces a 24-hour messaging window for business-initiated conversations:
| Timeframe | What You Can Send |
|---|---|
| Within 24 hours of customer's last message | Any message type (text, images, videos, etc.) |
| After 24 hours | Only pre-approved message templates |
Important LimitationIf you attempt to send an image message outside the 24-hour window, the API will return an error. Use message templates to reach customers after this window expires.
Supported Image Formats
Your image files must meet these requirements:
| Format | MIME Type | Typical Use Case | Maximum Size |
|---|---|---|---|
| JPEG | image/jpeg | Photos and general images | 5 MB |
| PNG | image/png | Graphics with transparency | 5 MB |
| WebP | image/webp | Optimized for smaller file sizes | 5 MB |
Best Practices
Tips for Better Delivery
- Optimize for mobile viewing – Most users will view images on mobile devices
- Choose the right format:
- JPEG for photographs
- PNG for graphics with transparency
- WebP for smaller file sizes and faster loading
- Keep captions concise – Short, relevant descriptions work best
- Test URLs before sending – Ensure image links are publicly accessible (no authentication required)
- Stay under the size limit – Compress images to stay well below 5 MB for faster delivery
Common Errors
| Issue | Possible Cause | Solution |
|---|---|---|
| Message rejected | 24-hour window expired | Use a message template instead |
| Image not delivered | URL not publicly accessible | Check that the URL loads without authentication |
| Format error | Unsupported image format | Use JPEG, PNG, or WebP only |
| File size error | Image exceeds 5 MB | Compress or resize the image |
Related Resources
- Upload Media API – Upload images to get a media ID
- Send Template Messages – Message customers outside the 24-hour window
- WhatsApp Business Authentication – Get your API token