WhatsApp API and webhooks for your CRM
Send order updates, OTPs, payment reminders and documents from your CRM, store or app with one HTTP request. Get delivery, read and failure statuses and every customer reply back as webhooks, so your system always knows what happened.
- REST API with JSON
- Templates, media and buttons
- Status and reply webhooks
- Works with any CRM

What is a WhatsApp API for CRM integration?
A WhatsApp API for CRM integration is an HTTP interface that lets a CRM, store or app send WhatsApp messages, such as approved templates, media and buttons, through the WhatsApp Business Platform. Webhooks send delivery, read and failure statuses and customer replies back to the same system as they happen.
Updated
WhatsApp API at a glance
- Interface
- REST API over HTTPS, JSON requests and responses
- Auth
- API key sent as a Bearer token
- Send
- Templates, text, media, buttons, lists, location
- Webhooks
- sent, delivered, read, failed, clicked, received
- Connects to
- Any CRM, ERP, store or app that can call an API
- No-code options
- Zapier, Google Sheets and plugins
How does the WhatsApp API connect to your CRM?
Your system starts the message, WhatsApp delivers it, and webhooks bring every status and reply back to the customer's record.
How do you send a WhatsApp template message by API?
To start a conversation, send an approved template by name with its language and the values for its variables. MsgClub replies with a message ID straight away; delivery and read statuses follow by webhook.
- Use the number in international format, for example 91 followed by the 10-digit mobile number
- Template name and language must match an approved template
- Variables fill the placeholders in order: name, order number, date
- Add a header image or PDF link if the template has a media header
curl -X POST "{API_BASE_URL}/whatsapp/messages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "919876543210",
"type": "template",
"template": {
"name": "order_shipped_v2",
"language": "en",
"header_media": "https://example.in/img/4182.jpg",
"variables": ["Priya", "4182", "14 Nov"]
},
"webhook_url": "https://crm.example.in/hooks/whatsapp"
}'$payload = [
"to" => "919876543210",
"type" => "template",
"template" => [
"name" => "order_shipped_v2",
"language" => "en",
"variables" => ["Priya", "4182", "14 Nov"],
],
];
$ch = curl_init("{API_BASE_URL}/whatsapp/messages");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$response = json_decode(curl_exec($ch), true);const res = await fetch("{API_BASE_URL}/whatsapp/messages", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
to: "919876543210",
type: "template",
template: {
name: "order_shipped_v2",
language: "en",
variables: ["Priya", "4182", "14 Nov"],
},
}),
});
const { message_id } = await res.json();Illustrative example. Exact endpoints and field names are in the API docs, shared when you get API access.
Which webhook events will you receive?
Set a webhook URL once, or per request, and MsgClub posts an event to it each time something happens to a message. Reply with HTTP 200 to acknowledge it.
| Event | When it is sent |
|---|---|
message.sent | The message was accepted by WhatsApp |
message.delivered | It reached the customer's phone |
message.read | The customer opened it (if read receipts are on) |
message.failed | It could not be delivered, with a reason |
message.clicked | The customer clicked a tracked link button |
message.received | The customer sent a message, tapped a reply button or shared media or a location |
{
"event": "message.read",
"message_id": "wamid.HBgMOTE5ODc2NTQzMjEwFQ",
"to": "919876543210",
"template": "order_shipped_v2",
"category": "utility",
"timestamp": "2026-11-14T10:43:05+05:30"
}{
"event": "message.received",
"message_id": "wamid.HBgMOTE5ODc2NTQzMjEwFR",
"from": "919876543210",
"profile_name": "Priya Sharma",
"type": "button_reply",
"button": { "id": "change_address", "title": "Change delivery address" },
"context": { "message_id": "wamid.HBgMOTE5ODc2NTQzMjEwFQ" },
"timestamp": "2026-11-14T10:44:12+05:30"
}Illustrative example. Exact endpoints and field names are in the API docs, shared when you get API access.
What else can you send through the API?
Inside the 24-hour customer service window you can send any of these without a template. Outside it, use a template that includes them.
message.received with the button ID.Good practice for developers
- Store the message ID with your record and match every webhook on it
- Process webhooks quickly and idempotently; the same event can arrive twice
- Check the 24-hour window before sending free-form text; otherwise use a template
- Keep your API key on the server, never in a browser or mobile app
- Send only to customers who opted in, and save the opt-in record
No developer? Use the panel or Zapier
Upload contacts and send broadcasts from the web panel, answer in the team inbox, automate replies with the chatbot, or connect Google Sheets, Zapier and other tools. The same account also sends SMS by API as a fallback.
See all channels on the integrations page, code samples in the developer docs, and message costs in the WhatsApp pricing guide and pricing.
Frequently asked questions
How do I get WhatsApp API access from MsgClub?
Sign up, connect your number to the WhatsApp Business API with our onboarding team, and get your first templates approved. You then receive an API key and the API documentation with exact endpoints and field names. Your developers can then send a test template to their own number before going live.
Can I send free-form messages through the API?
Yes, but only while the 24-hour customer service window is open, which happens when the customer has messaged you in the last 24 hours. Outside the window the API accepts only approved template messages. If you send a free-form message to a closed window, it fails with an error you receive by webhook.
Which CRMs can I connect to the WhatsApp API?
Any CRM or software that can make an HTTP request or receive a webhook, including in-house systems. Teams connect tools such as Zoho CRM, HubSpot, LeadSquared and Salesforce through their own API features or Zapier, and Google Sheets through MsgClub's plugin. No native one-click connector is needed.
What webhook events does the WhatsApp API send?
MsgClub sends message.sent, message.delivered, message.read and message.failed for messages you send, message.clicked for tracked button clicks, and message.received for every customer reply, with the message text or media link. Each event carries the message ID so you can match it to your record.
Can I send PDFs, images and buttons through the WhatsApp API?
Yes. You can send images, videos, audio and documents such as invoices, either as the header of a template or as a free-form message inside the service window. Inside the window you can also send up to 3 reply buttons or a list of up to 10 options, and receive the customer's choice by webhook.
Is there a sandbox or test number?
During onboarding we help you send test messages to your own numbers before you go live, so your developers can check templates, variables and webhooks. Ask our team for the current testing options when you request API access.
Related products
Use them together from the same MsgClub account, with one API and shared reports.
Start sending in minutes
Create a free account to test the panel and API, or talk to our team about volumes, DLT setup and CRM integration.