api docs
api docs

Send Image Message

Send an image message to a single WhatsApp recipient via the WhatAPI REST API.

Send Image Message

Send an image message to a single WhatsApp recipient.

Scope: `send_media` | Method: `POST`
POST /api/v1/messages/send-image

Request Body

ParameterTypeRequiredDescription
tostringYesRecipient phone number with country code
imagestringYesPublic direct URL to the image file or base64-encoded data string
captionstringNoText description displayed below the image
fileNamestringNoCustom download filename (default: `image.png`)
session_idstringNoOverrides the default assigned WhatsApp session

Example Request

curl -X POST "https://whatapi.pk/api/v1/messages/send-image" \
  -H "Authorization: Bearer whatapi_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "923001234567",
    "image": "https://example.com/invoice.png",
    "caption": "Here is your invoice",
    "fileName": "invoice.png"
  }'

Response

{
  "success": true,
  "message_id": "gBGGK2Lx8K5X7J",
  "to": "923001234567",
  "session": "session-uuid",
  "timestamp": "2026-07-02T12:00:00.000Z"
}

Notes

  • The `image` field accepts both public HTTP/HTTPS URLs and base64-encoded data URIs
  • Supported formats: JPEG, PNG, GIF, WebP
  • Maximum file size depends on your WhatsApp session configuration
  • The `fileName` parameter is passed to the WhatsApp client as the suggested download name