Skip to main content

Send Image Message

Sends an image message via the WhatsApp Business Cloud API. Images can be sent using a public URL or a Media ID from uploaded media.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Phone Number ID - WhatsApp Business Phone Number ID from Meta Developer Portal.
  • To Phone Number - Recipient's phone number with country code (without + sign). Example: 1234567890.
  • Image URL - Public HTTPS URL of the image or Media ID from uploaded media.

Options

  • API Version - Meta Graph API version. Default is 21.0.
  • Caption - Optional image caption (max 1024 characters).
  • Use Media ID - Set to true to use Media ID instead of URL. Default is false.
  • Access Token - WhatsApp Cloud API Access Token credential (required).

Output

  • Response - The complete API response object containing message details and status.

How It Works

The Send Image Message node sends an image to a WhatsApp user. When executed, the node:

  1. Validates all required inputs
  2. Retrieves the access token from the credential
  3. Constructs the message payload with either URL or Media ID
  4. Adds optional caption if provided
  5. Sends a POST request to the WhatsApp API
  6. Returns the API response with message details

Requirements

  • A WhatsApp Business Account in Meta Developer Portal
  • Access Token with appropriate permissions
  • For URLs: Image must be publicly accessible via HTTPS
  • For Media IDs: Media must be uploaded using Upload Media node
  • Image must be in supported format and size

Supported Image Formats

  • JPEG (.jpg, .jpeg)
  • PNG (.png)

Maximum file size: 5 MB

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Phone Number ID
  • Empty or invalid recipient phone number
  • Empty or invalid Image URL
  • Image URL not accessible (404, 403 errors)
  • Image URL not HTTPS
  • Image exceeds size limit (5 MB)
  • Unsupported image format
  • Invalid Media ID
  • Invalid access token
  • Network connectivity issues

Using Public URLs

When using public URLs (Use Media ID = false):

  • URL must be HTTPS (HTTP is not supported)
  • Image must be publicly accessible (no authentication required)
  • URL should directly link to the image file
  • Temporary URLs should have sufficient validity time
  • Consider using cloud storage (AWS S3, Google Cloud Storage, Azure Blob)

Using Media IDs

When using Media IDs (Use Media ID = true):

  1. First upload the image using the Upload Media node
  2. Get the Media ID from the upload response
  3. Use the Media ID in this node
  4. Media IDs are valid for a limited time (typically 30 days)

Example: Send Image with URL

Inputs:

  • Phone Number ID: 123456789012345
  • To Phone Number: 14155551234
  • Image URL: https://example.com/product-image.jpg

Options:

  • Caption: Check out our new product!
  • Use Media ID: false

Output:

{
"messaging_product": "whatsapp",
"contacts": [
{
"input": "14155551234",
"wa_id": "14155551234"
}
],
"messages": [
{
"id": "wamid.HBgNMTIzNDU2Nzg5MAAV..."
}
]
}

Example: Send Image with Media ID

Flow:

  1. Upload Media node outputs Media ID: 1234567890
  2. Send Image Message node:

Inputs:

  • Phone Number ID: 123456789012345
  • To Phone Number: 14155551234
  • Image URL: 1234567890 (the Media ID)

Options:

  • Caption: Your requested image
  • Use Media ID: true

Example: Product Catalog Image

Use Case: Send product images to customers

Inputs:

  • Phone Number ID: 123456789012345
  • To Phone Number: {{customer.phone}}
  • Image URL: {{product.imageUrl}}

Options:

  • Caption: {{product.name}} - ${{product.price}}\n\n{{product.description}}

Usage Notes

  • Captions support WhatsApp markdown formatting (bold, italic, strikethrough, monospace)
  • Images are automatically compressed by WhatsApp if needed
  • Aspect ratios are preserved
  • Very large images may take longer to send and receive
  • For better performance, optimize images before sending (reduce resolution, compress)
  • Media IDs expire after 30 days, use URLs for long-term storage
  • Consider image dimensions: 640x640 to 1024x1024 works well for most use cases

Tips for RPA Developers

  • Store product images in cloud storage and use permanent URLs
  • Generate dynamic captions with product details and pricing
  • Implement image validation before sending (check file exists, size, format)
  • Use Upload Media node for local files
  • Cache Media IDs to reuse within the 30-day window
  • For bulk sending, use a queue to manage rate limits
  • Monitor image delivery status in the API response
  • Implement fallback to text message if image fails to send
  • Consider using CDN for faster image delivery

Common Errors and Solutions

Error: URL not accessible

  • Verify the URL is publicly accessible (try in browser)
  • Check for authentication requirements
  • Ensure URL uses HTTPS, not HTTP
  • Verify the server allows external requests

Error: Image too large

  • Compress the image before sending
  • Reduce image resolution
  • Maximum size is 5 MB

Error: Invalid image format

  • Convert image to JPEG or PNG
  • Check file extension matches actual format
  • Avoid using WebP, GIF, or other formats

Error: Invalid Media ID

  • Media ID may have expired (30-day limit)
  • Upload the media again to get a fresh ID
  • Verify you're using the correct Media ID

Best Practices

  • Use descriptive captions to provide context
  • Optimize images for mobile viewing
  • Test image visibility on different devices
  • Keep file sizes reasonable for faster delivery
  • Use appropriate image dimensions for the content type
  • Don't send copyrighted images without permission
  • Follow WhatsApp Business Policy for image content
  • Include product/reference IDs in captions for tracking