WhatsApp Business API
Send template messages, interactive buttons, media, and build chatbot flows on WhatsApp. 98% open rate. Meta-approved platform with official Business Solution Provider (BSP) status.
Supported Message Types
Text
Plain text messages up to 4,096 characters
Image
JPG/PNG up to 5MB with optional caption
Document
PDF, DOCX, XLSX up to 100MB
Video
MP4 up to 16MB with optional caption
Buttons
Up to 3 quick-reply or CTA buttons
List
Menu of up to 10 items with sections
Location
Lat/long with address and label
Templates
Pre-approved outbound notification messages
Quick Start — Template Message
Send a pre-approved template message (e.g. order confirmation, OTP) to a customer.
# Send a pre-approved template message
curl -X POST https://api.connexbetter.com/v1/whatsapp/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"type": "template",
"template": {
"name": "order_confirmation",
"language": { "code": "en" },
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "Rahul" },
{ "type": "text", "text": "ORD-123456" },
{ "type": "text", "text": "15 Sep 2025" }
]
}
]
}
}'Authentication
All requests require a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEYGenerate keys from Dashboard → Settings → API Keys. Your WABA ID and phone number ID are provisioned automatically when your account is approved.
API Endpoints
/v1/whatsapp/sendSend a template or free-form message
/v1/whatsapp/send-bulkSend template messages to multiple recipients
/v1/whatsapp/media/uploadUpload media for use in messages
/v1/whatsapp/media/:mediaIdRetrieve uploaded media URL or metadata
/v1/whatsapp/templatesList all your approved message templates
/v1/whatsapp/templatesSubmit a new template for Meta approval
/v1/whatsapp/status/:messageIdGet delivery and read status for a message
/v1/whatsapp/analyticsGet message analytics for a date range
Send Message — Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| to | string | Yes | Recipient's WhatsApp number in E.164 format (+91XXXXXXXXXX) |
| type | string | Yes | 'text', 'template', 'image', 'document', 'video', 'audio', 'interactive', 'location' |
| template | object | Conditional | Required when type is 'template'. Contains name, language, and components |
| text | object | Conditional | Required when type is 'text'. { body: 'message text' } |
| image | object | Conditional | Required when type is 'image'. { url: '...' } or { id: 'media-id' }, optional caption |
| interactive | object | Conditional | Required when type is 'interactive'. Defines button or list message structure |
| callback_url | string | No | Webhook URL for delivery/read receipt events for this message |
| context | object | No | Reply to a specific incoming message: { message_id: 'wamid...' } |
Response Format
{
"success": true,
"messageId": "wamid.HBgMOTE5OD",
"to": "+919876543210",
"status": "sent",
"timestamp": "2025-09-15T10:30:00Z",
"type": "template"
}Interactive Buttons Example
# Send a message with quick-reply buttons
curl -X POST https://api.connexbetter.com/v1/whatsapp/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"type": "interactive",
"interactive": {
"type": "button",
"body": {
"text": "Your order #ORD-123456 is ready for pickup. Do you want delivery instead?"
},
"action": {
"buttons": [
{ "type": "reply", "reply": { "id": "pickup_yes", "title": "Pick up" } },
{ "type": "reply", "reply": { "id": "delivery_yes", "title": "Deliver it" } }
]
}
}
}'Code Examples
import requests
# Send OTP via WhatsApp template
response = requests.post(
"https://api.connexbetter.com/v1/whatsapp/send",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"to": "+919876543210",
"type": "template",
"template": {
"name": "otp_verification",
"language": {"code": "en"},
"components": [{
"type": "body",
"parameters": [{"type": "text", "text": "847291"}]
}]
}
}
)
data = response.json()
print(f"Message ID: {data['messageId']}")
print(f"Status: {data['status']}")const axios = require('axios');
// Send image with caption
const response = await axios.post(
'https://api.connexbetter.com/v1/whatsapp/send',
{
to: '+919876543210',
type: 'image',
image: {
url: 'https://your-cdn.com/product-catalogue.jpg',
caption: 'Check out our latest Diwali collection! 🪔'
}
},
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
console.log('Message ID:', response.data.messageId);Webhooks — Incoming Messages & Delivery Events
ConnexBetter forwards all WhatsApp events to your webhook URL: delivery receipts, read receipts, and incoming customer messages.
POST https://your-server.com/whatsapp-webhook
{
"event": "message.delivered",
"messageId": "wamid.HBgMOTE5OD",
"to": "+919876543210",
"status": "delivered",
"timestamp": "2025-09-15T10:30:12Z"
}
// Incoming customer message
{
"event": "message.received",
"from": "+919876543210",
"messageId": "wamid.incoming123",
"type": "text",
"text": { "body": "Hello, I need help with my order" },
"timestamp": "2025-09-15T10:31:00Z"
}Frequently Asked Questions
What types of WhatsApp messages can I send via the API?
You can send template messages (pre-approved by Meta), free-form messages within 24-hour customer service windows, text, images, documents, videos, audio, location, contacts, interactive buttons (up to 3), and list messages (up to 10 items).
How long does WhatsApp Business API approval take?
Meta's approval process for new WhatsApp Business Account (WABA) setup typically takes 3–5 business days. ConnexBetter handles the submission and verification process for you. Template message approval usually takes 24–48 hours after submission.
What is a 24-hour customer service window?
When a customer messages your WhatsApp number, you have a 24-hour window to reply with any message type. Outside this window, you can only send pre-approved template messages. This is Meta's policy to prevent spam.
What are WhatsApp message templates?
Templates are pre-approved message formats submitted to Meta. They are required for outbound business-initiated messages (notifications, OTPs, alerts). Templates can include text, media, variables ({{1}}, {{2}}), and call-to-action or quick-reply buttons.
What is the rate limit for WhatsApp API?
Rate limits depend on your WhatsApp tier: Tier 1: 1,000 unique conversations/day, Tier 2: 10,000/day, Tier 3: 100,000/day, Tier 4: unlimited. Tier upgrades happen automatically when you maintain quality ratings and message volume.
How do I receive incoming WhatsApp messages?
Configure a webhook URL in your ConnexBetter dashboard. We forward incoming messages, delivery receipts, read receipts, and button click events to your webhook as HTTP POST requests in real time.
Ready to integrate WhatsApp Business API?
Schedule a demo with our team and go live with WhatsApp messaging in 3–5 business days.