Messaging API - Send Messages During Active Conversation Window
If you want to send free-form WhatsApp messages from your website, app, or automation tools like Zapier or Pabbly, you can use our Messages API to do so. Kindly note that you'll be able to send messages using this API only during an active conversation window.
Note: This is an advanced feature and may require a developer to implement if you’re not familiar with REST API.
Table of Contents
Messaging API Overview
Send a WhatsApp message to a contact using their WhatsApp number or contact ID.
Request syntax
POST https://app.wanotifier.com/api/v1/messages?key=<YOUR_API_KEY>
Request POST data
{
"recipient": {
"whatsapp_number": "+919876543210", // WhatsApp number (with country code)
"contact_id": 123456 // (optional) Contact ID
},
"message": {
"type": "<TYPE>", // Message type (see below)
"<type_payload>": { ... } // Message body specific to type (see below)
}
}
You must specify at least one recipient field: either whatsapp_number
or contact_id
. If both are provided, contact_id
takes priority.
Request fields
Field name | Type | Description |
---|---|---|
key | string | Your WANotifier API key. You can get it from the Settings > API page. Required |
recipient | object | Recipient information: WhatsApp number or contact ID. |
message | object | Message object (type + type-specific payload, details below). |
Example request
curl --location 'https://app.wanotifier.com/api/v1/messages?key=A7X4P9Q2MZ1D6T8R' \
--header 'Content-Type: application/json' \
--data '{
"recipient": {
"whatsapp_number": "+919876543210"
},
"message": {
"type": "text",
"text": {
"body": "Hello, this is a test message from API."
}
}
}'
Message Types & Payloads
The type
field in the message
object determines what kind of WhatsApp message you send. We have tried to keep the structure of these requests as similar to the WhatsApp Cloud API Messaging API as possible.
Payload structure for each message type:
- Text message
- Image message
- Video message
- Document message
- Audio message
- Sticker message
- Location message
- Interactive Flow message
- Interactive list message
- Interactive button message
1. Text message
{
"type": "text",
"text": {
"preview_url": true, // Show link preview
"body": "Your message goes here" // Text message content
}
}
2. Image message
{
"type": "image",
"image": {
"link": "https://example.com/path/image.jpg", // Static image file URL
"caption": "Optional caption" // Image caption
}
}
- Only static image URLs hosted on public servers are supported. Google drive or other dynamic page links not allowed.
- Supported file types: jpeg and png
- Max file size: 5 MB
3. Video message
{
"type": "video",
"video": {
"link": "https://yourdomain.com/path/video.mp4", // Static video file URL
"caption": "Optional caption" // Video caption
}
}
- Only static video URLs hosted on public servers are supported. Google drive or other dynamic page links not allowed.
- Supported file types: mp4 and 3gp
- Max file size: 15 MB
4. Document message
{
"type": "document",
"document": {
"link": "https://yourdomain.com/path/file.pdf", // Static document file URL
"filename": "OptionalFileName.pdf", // Document final name
"caption": "Optional caption" // Document caption
}
}
- Only static document URLs hosted on public servers are supported. Google drive or other dynamic page links not allowed.
- Support file formats: txt, xls, xlsx, doc, docx, ppt, pptx and pdf
- Max file size: 100 MB
5. Audio message
{
"type": "audio",
"audio": {
"link": "https://yourdomain.com/path/audio.mp3" // Static audio file URL
}
}
- Only static audio URLs hosted on public servers are supported. Google drive or other dynamic page links not allowed.
- Support file formats: aac, amr, mp3, m4a and ogg
- Max file size: 16 MB
6. Sticker message
{
"type": "sticker",
"sticker": {
"link": "https://yourdomain.com/path/sticker.webp" // Static sticker file URL
}
}
- Only static sticker URLs hosted on public servers are supported. Google drive or other dynamic page links not allowed.
- Support file formats: webp (animated or static)
- Max file size: 500 KB for animated webp and 100 KB for static webp
7. Location message
{
"type": "location",
"location": {
"latitude": 18.5204, // Location latitude
"longitude": 73.8567, // Location longitude
"name": "Company HQ", // Location name
"address": "Baner, Pune, India" // Location address
}
}
8. Interactive Flow message
{
"type": "interactive",
"interactive": {
"type": "flow",
"header": {
"type": "text", // Flow header type
"text": "Flow message header" // Flow header text
},
"body": {
"text": "Flow message body" // Flow body text
},
"footer": {
"text": "Flow message footer" // Flow footer text
},
"action": {
"name": "flow",
"parameters": {
"flow_message_version": "3", // Flow version
"flow_id": "sample_flow_id", // Flow unique id
"flow_cta": "Book!" // Flow call-to-action button text
}
}
}
}
8. Interactive list message
{
"type": "interactive",
"interactive": {
"type": "list",
"header": {
"type": "text", // List header type
"text": "Flow message header" // List header text
},
"body": {
"text": "Flow message body" // List body text
},
"footer": {
"text": "Flow message footer" // List footer text
},
"action": {
"button": "Choose Option", // List CTA button text
"sections": [ // List sections
{
"title": "Fruits", // List section title
"rows": [ // List section rows
{
"id": "apple_id",
"title": "Apple",
"description": "Fresh red apple"
},
{
"id": "banana_id",
"title": "Banana",
"description": "Sweet banana"
}
]
},
{
"title": "Vegetables",
"rows": [
{
"id": "carrot_id",
"title": "Carrot",
"description": "Crunchy carrot"
},
{
"id": "spinach_id",
"title": "Spinach",
"description": "Green spinach leaves"
}
]
}
]
}
}
}
8. Interactive button message
{
"type": "interactive",
"interactive": {
"type": "button",
"body": {
"text": "Do you want to proceed?"
},
"action": {
"buttons": [
{
"type": "reply",
"reply": {
"id": "yes_button",
"title": "Yes"
}
},
{
"type": "reply",
"reply": {
"id": "no_button",
"title": "No"
}
}
]
}
}
}
Message status & responses
Example success response
{
"message": "Message sent successfully.",
"error": false,
}
Example error response
{
"message": "Invalid WhatsApp number.",
"error": true
}
Updated on: 04/08/2025
Thank you!