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_abc123

Template 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); // 5000

Supported message types

TypeWhen to useTemplate required?
templateOutside 24-hour window, broadcasts, OTPYes
textReply within 24h conversation windowNo
mediaImages, docs, videos via URLFor outbound
interactiveButtons, list menus, quick repliesYes for outbound

Rate limits

EndpointLimit
POST /whatsapp/send1,000 messages/minute per WABA number
POST /whatsapp/broadcasts100 broadcasts/day; up to 100k recipients each
Global (all endpoints)100 requests/minute per API key

Downloads & tools