# Image Messages

> Send WhatsApp image messages: photos and graphics with optional captions. JPEG/PNG up to 5MB, automatic CDN delivery and template support.

Send images with optional captions to share product photos, receipts, or visual content.

## Send an Image

```typescript
const result = await zavu.messages.send({
  to: "+14155551234",
  channel: "whatsapp",
  messageType: "image",
  content: {
    mediaUrl: "https://example.com/product.jpg",
  },
});
```

```bash
curl -X POST https://api.zavu.dev/v1/messages \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+14155551234",
    "channel": "whatsapp",
    "messageType": "image",
    "content": {
      "mediaUrl": "https://example.com/product.jpg"
    }
  }'
```

## Image with Caption

```typescript
const result = await zavu.messages.send({
  to: "+14155551234",
  channel: "whatsapp",
  messageType: "image",
  text: "Check out our new product!",
  content: {
    mediaUrl: "https://example.com/product.jpg",
  },
});
```

```bash
curl -X POST https://api.zavu.dev/v1/messages \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+14155551234",
    "channel": "whatsapp",
    "messageType": "image",
    "text": "Check out our new product!",
    "content": {
      "mediaUrl": "https://example.com/product.jpg"
    }
  }'
```

## Specifications

| Property | Requirement |
|----------|-------------|
| Formats | JPEG, PNG |
| Max size | 5 MB |
| Caption | Optional, max 1024 chars |

## URL Requirements

Your image URL must:

- Be publicly accessible (no authentication)
- Use HTTPS
- Return the correct `Content-Type` header
- Be available for at least 24 hours

> **Warning:**
> Private or expiring URLs will cause delivery failures. Use a CDN or cloud storage for reliable hosting.

## Use Cases

- Product photos
- Order receipts
- QR codes
- Promotional banners
- Visual instructions
