Articles on: API Documentation

Messaging API - Send Messages During Active Conversation Window

If you want to send 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.


View our full REST API Postman collection here


Note: This is an advanced feature and may require a developer to implement if you’re not familiar with REST APIs or webhooks.


Table of Contents




Send message


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. Payload structure for each type:


1. Text message


{
"type": "text",
"text": {
"body": "Your message goes here"
}
}


2. Image message


{
"type": "image",
"image": {
"url": "https://yourdomain.com/path/image.jpg",
"caption": "Optional caption"
}
}

Note: Only image URLs hosted on public servers are supported.


3. Video message


{
"type": "video",
"video": {
"url": "https://yourdomain.com/path/video.mp4",
"caption": "Optional caption"
}
}


4. Document message


{
"type": "document",
"document": {
"url": "https://yourdomain.com/path/file.pdf",
"filename": "OptionalFileName.pdf",
"caption": "Optional caption"
}
}


5. Audio message


{
"type": "audio",
"audio": {
"url": "https://yourdomain.com/path/audio.mp3"
}
}


6. Sticker message


{
"type": "sticker",
"sticker": {
"url": "https://yourdomain.com/path/sticker.webp"
}
}


7. Location message


{
"type": "location",
"location": {
"latitude": 18.5204,
"longitude": 73.8567,
"name": "Company HQ",
"address": "Baner, Pune, India"
}
}



Message status & responses


Example success response


{
"message": "Message sent successfully.",
"error": false,
}


Example error response


{
"message": "Invalid WhatsApp number.",
"error": true
}


Updated on: 01/08/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!