WhatsApp Messaging API
Send approved WhatsApp template messages, or free-form text inside an active 24-hour customer service window, through a connected WhatsApp Business Account. Available send methods and volume depend on package access, account status, permissions, and provider limits.
Public send methods
Approved template, free-form text
Delivery status
Reported by the connected provider
Per-phone limit
5 messages per hour
Template approval
Managed in Meta Business tools
Send a template message
POST /api/v1/whatsapp/messages/send — Send one approved template. Requires the whatsapp:send scope and an active WhatsApp package.
import { createClient } from '@emacrontechnologies/outreachagent';
const oa = createClient(process.env.API_KEY);
// Send an approved WhatsApp template message
const result = await oa.whatsapp.sendTemplate({
to: '+919876543210',
template: 'order_confirmation',
language: 'en_US',
variables: {
'1': 'ORD-12345',
'2': '2,499',
},
});
console.log(result.message_id);Template variables
WhatsApp templates use numbered placeholders like {{1}}, {{2}}. Map each placeholder to a value in the variables object, using the placeholder index or name as the key.
Example template body
"Your order {{1}} for ₹{{2}} has been shipped. Track at {{3}}"
Mapped variables
Send free-form text
POST /api/v1/whatsapp/messages/send-text — Send plain text only inside the 24-hour customer service window. For business-initiated messages, use an approved template instead.
// Only within the 24-hour customer service window
const result = await oa.whatsapp.sendText({
to: '+919876543210',
text: 'Hello! Your order #12345 has been shipped.',
});
console.log(result.message_id);Supported message types
| Type | When to use | Template required? |
|---|---|---|
template | Business-initiated messages, notifications, and OTP | Yes |
text | Reply inside the 24-hour customer service window | No |
Media and interactive messages are not exposed by the public send endpoints. Bulk broadcasts are managed in the CRM app; the public API sends one recipient per request.
Rate limits
| Endpoint | Limit |
|---|---|
| POST /whatsapp/messages/send | 5 messages per phone per hour |
| POST /whatsapp/messages/send-text | 5 messages per phone per hour |
| All API endpoints | 1,000 requests per hour per API key (workspace-configurable) |
| Provider limits | Meta also applies limits to the connected WhatsApp Business Account |