> ## Documentation Index
> Fetch the complete documentation index at: https://meta-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Messages

> Image messages are messages that display a single image and an optional caption.

<Frame>
  <img src="https://mintcdn.com/meta-preview/xMiwyYRUQd9GqgJ7/images/image-message.png?fit=max&auto=format&n=xMiwyYRUQd9GqgJ7&q=85&s=db0cf752397618ec4eaaa90c10152e7a" width="1470" height="1034" data-path="images/image-message.png" />
</Frame>

## Sending Image Messages

Use the **[POST /\<WHATSAPP\_BUSINESS\_PHONE\_NUMBER\_ID>/messages](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages)** endpoint to send an image message to a WhatsApp user.

### Request Syntax

```bash theme={null}
POST /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages
```

### Post Body

```json theme={null}
{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "<WHATSAPP_USER_PHONE_NUMBER>",
  "type": "image",
  "image": {
    "id" : "<MEDIA_ID>", /* Only if using uploaded media */
    "link": "<MEDIA_URL>", /* Only if linking to your media */
    "caption": "<IMAGE_CAPTION_TEXT>"
  }
}
```

### Post Body Parameters

<ParamField body="<IMAGE_CAPTION_TEXT>" type="string" optional>
  Image caption text.

  Maximum 1024 characters.

  Example: The best succulent ever?
</ParamField>

<ParamField body="<MEDIA_ID>" type="string" required>
  **Required if using an uploaded media asset (recommended)**.

  [Uploaded media](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#upload-media) asset ID.

  Example: 1479537139650973
</ParamField>

<ParamField body="<MEDIA_URL>" type="string" required>
  **Required if linking to your media asset (not recommended)**

  URL of image asset on your public server. For better performance, we recommend that you [upload your media asset](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#upload-media) instead.

  Example: [https://www.luckyshrub.com/assets/succulents/aloe.png](https://www.luckyshrub.com/assets/succulents/aloe.png)
</ParamField>

<ParamField body="<WHATSAPP_USER_PHONE_NUMBER>" type="string" required>
  **Required.** WhatsApp user phone number.

  Example: +16505551234
</ParamField>

## Supported Image Formats

Images must be 8-bit, RGB or RGBA.

| Image Type | Extension | MIME Type  | Max Size |
| ---------- | --------- | ---------- | -------- |
| JPEG       | .jpeg     | image/jpeg | 5 MB     |
| PNG        | .png      | image/png  | 5 MB     |

## Example Request

Example request to send an image message with a caption to a WhatsApp user.

<RequestExample>
  ```bash Example Request theme={null}
  curl 'https://graph.facebook.com/v22.0
  /106540352242922/messages' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer EAAJB...' \
  -d '
  {
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "+16505551234",
    "type": "image",
    "image": {
      "id" : "1479537139650973",
      "caption": "The best succulent ever?"
    }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Example Response theme={null}
  {
    "messaging_product": "whatsapp",
    "contacts": [
      {
        "input": "+16505551234",
        "wa_id": "16505551234"
      }
    ],
    "messages": [
      {
        "id": "wamid.HBgLMTY0NjcwNDM1OTUVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
      }
    ]
  }
  ```
</ResponseExample>
