> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zavu.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Messages

> Send images via WhatsApp

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

## Send an Image

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

  ```python Python theme={null}
  result = zavu.messages.send(
      to="+14155551234",
      channel="whatsapp",
      message_type="image",
      content={
          "media_url": "https://example.com/product.jpg"
      }
  )
  ```

  ```ruby Ruby theme={null}
  result = client.messages.send(
    to: "+14155551234",
    channel: "whatsapp",
    message_type: "image",
    content: {
      media_url: "https://example.com/product.jpg"
    }
  )
  ```

  ```go Go theme={null}
  result, err := client.Messages.Send(context.TODO(), zavudev.MessageSendParams{
      To:          zavudev.String("+14155551234"),
      Channel:     zavudev.String("whatsapp"),
      MessageType: zavudev.String("image"),
      Content: &zavudev.MessageContentParams{
          MediaURL: zavudev.String("https://example.com/product.jpg"),
      },
  })
  ```

  ```php PHP theme={null}
  $result = $client->messages->send([
      'to' => '+14155551234',
      'channel' => 'whatsapp',
      'messageType' => 'image',
      'content' => [
          'mediaUrl' => 'https://example.com/product.jpg',
      ],
  ]);
  ```

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

## Image with Caption

<CodeGroup>
  ```typescript TypeScript theme={null}
  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",
    },
  });
  ```

  ```python Python theme={null}
  result = zavu.messages.send(
      to="+14155551234",
      channel="whatsapp",
      message_type="image",
      text="Check out our new product!",
      content={
          "media_url": "https://example.com/product.jpg"
      }
  )
  ```

  ```ruby Ruby theme={null}
  result = client.messages.send(
    to: "+14155551234",
    channel: "whatsapp",
    message_type: "image",
    text: "Check out our new product!",
    content: {
      media_url: "https://example.com/product.jpg"
    }
  )
  ```

  ```go Go theme={null}
  result, err := client.Messages.Send(context.TODO(), zavudev.MessageSendParams{
      To:          zavudev.String("+14155551234"),
      Channel:     zavudev.String("whatsapp"),
      MessageType: zavudev.String("image"),
      Text:        zavudev.String("Check out our new product!"),
      Content: &zavudev.MessageContentParams{
          MediaURL: zavudev.String("https://example.com/product.jpg"),
      },
  })
  ```

  ```php PHP theme={null}
  $result = $client->messages->send([
      'to' => '+14155551234',
      'channel' => 'whatsapp',
      'messageType' => 'image',
      'text' => 'Check out our new product!',
      'content' => [
          'mediaUrl' => 'https://example.com/product.jpg',
      ],
  ]);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.zavu.dev/v1/messages \
    -H "Authorization: Bearer $ZAVU_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"
      }
    }'
  ```
</CodeGroup>

## 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.
</Warning>

## Use Cases

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