WhatsApp Messaging API
Send WhatsApp template messages to individual contacts or broadcast to thousands at once. All messages go through the official Meta WhatsApp Business API — no grey-market routes.
Message types
Template, text, media, interactive
Delivery rate
98%+ (official Meta BSP)
Max broadcast size
Up to 100,000 recipients
Template approval
Typically 1–2 hours
Send a message
POST /whatsapp/send — Send a template or free-form message.
import { createClient } from '@emacrontechnologies/outreachagent';
const oa = createClient(process.env.API_KEY);
// Send a WhatsApp template message
const result = await oa.sendMessage({
to: '+919876543210',
type: 'template',
template: {
name: 'order_confirmation',
language: 'en',
components: [
{
type: 'body',
parameters: [
{ type: 'text', text: 'ORD-12345' },
{ type: 'text', text: '₹2,499' },
],
},
],
},
});
console.log(result.message_id); // wa_msg_abc123Template variables
WhatsApp templates use numbered placeholders like {{1}}, {{2}}. Each maps to a parameter in order.
Example template body
"Your order {{1}} for ₹{{2}} has been shipped. Track at {{3}}"
Mapped parameters
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "ORD-12345" }, // {{1}}
{ "type": "text", "text": "2499" }, // {{2}}
{ "type": "text", "text": "track.xyz/12345" } // {{3}}
]
}
]
Broadcast to multiple recipients
POST /whatsapp/broadcasts — Send one template to up to 100,000 recipients.
const broadcast = await oa.createBroadcast({
name: 'Diwali Sale 2026',
template_name: 'diwali_offer_v3',
language: 'en',
recipients: [
'+919876543210',
'+918765432109',
// ... up to 100k recipients
],
schedule_at: '2026-10-20T14:30:00Z', // optional
});
console.log(broadcast.broadcast_id); // bc_xyz789
console.log(broadcast.total_recipients); // 5000Supported message types
| Type | When to use | Template required? |
|---|---|---|
template | Outside 24-hour window, broadcasts, OTP | Yes |
text | Reply within 24h conversation window | No |
media | Images, docs, videos via URL | For outbound |
interactive | Buttons, list menus, quick replies | Yes for outbound |
Rate limits
| Endpoint | Limit |
|---|---|
| POST /whatsapp/send | 1,000 messages/minute per WABA number |
| POST /whatsapp/broadcasts | 100 broadcasts/day; up to 100k recipients each |
| Global (all endpoints) | 100 requests/minute per API key |