API v2.0 â€ĸ RESTful â€ĸ 99.9% Uptime

WhatsApp Business API Documentation

Complete API reference with code examples in Node.js, Python, and PHP. Send messages, manage contacts, handle webhooks, and integrate WhatsApp Flows.

10+
API Endpoints
8
Webhook Events
99.9%
API Uptime
<50ms
Avg Response

🚀Quick Start Guide

Prerequisites

  • ✓SyncWABA account with Scale or Enterprise plan (API access not available on Free/Start plans)
  • ✓WhatsApp Business Number connected
  • ✓API key from Dashboard → Settings → API Keys

5-Minute Setup

1

Get Your API Key

Navigate to Dashboard → Settings → API Keys → Generate New Key

2

Make Your First API Call

Send a test message using the code example below

3

Configure Webhooks (Optional)

Set up webhook URL to receive message status updates

cURL
curl -X POST https://app.syncwaba.com/api/integrations/messages/send \
  -H "X-API-Key: sk_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "type": "template",
    "templateName": "welcome_message",
    "templateVariables": {
      "1": "John"
    },
    "category": "utility"
  }'
💡

Testing Tip

Use our Postman collection to test all endpoints interactively. Download it from the button above!

🔐Authentication

SyncWABA API uses API key authentication. Include your API key in the X-API-Key header with every request.

Get Your API Key

  1. Log in to your SyncWABA dashboard
  2. Navigate to Settings → API Keys
  3. Click "Generate New Key"
  4. Give your key a name (e.g., "Production API")
  5. Copy and securely store the key (shown only once)

Authentication Header

X-API-Key: sk_live_your_api_key_here
âš ī¸

Security Best Practices

  • â€ĸ Never expose API keys in client-side code or public repositories
  • â€ĸ Use environment variables to store API keys
  • â€ĸ Rotate API keys periodically
  • â€ĸ Create separate keys for development and production

🌐Base URL & Configuration

API Base URL

https://app.syncwaba.com

All API endpoints are relative to this base URL.

⚡Rate Limits

Endpoint TypeRate Limit
Account endpoints10 requests/minute
Message endpoints60 requests/minute
Flow endpoints30 requests/minute
Contact endpoints30 requests/minute
Template endpoints30 requests/minute
â„šī¸

Rate Limit Headers

Check the X-RateLimit-Remaining and X-RateLimit-Reset response headers to monitor your usage.

đŸ’ŦSend Messages

Send Template Message

Send an approved WhatsApp template message. Use this for marketing, authentication, or utility messages.

POST/api/integrations/messages/send

Request Headers

Content-Type: application/json
X-API-Key: sk_live_your_api_key_here

Request Body

{
  "to": "+919876543210",
  "type": "template",
  "templateName": "welcome_message",
  "templateVariables": {
    "1": "John",
    "2": "Premium Plan"
  },
  "category": "utility"
}

Parameters

ParameterTypeRequiredDescription
tostringRequiredPhone number in E.164 format (+91XXXXXXXXXX)
typestringRequiredMessage type: template
templateNamestringRequiredName of approved WhatsApp template
templateVariablesobjectOptionalVariables for template placeholders (1-indexed)
categorystringRequiredauthentication, marketing, utility, or service

Success Response (200 OK)

{
  "success": true,
  "data": {
    "message_id": "msg_1234567890abcdef",
    "to": "+919876543210",
    "status": "sent",
    "template_name": "welcome_message",
    "category": "utility",
    "cost": {
      "amount": 0.115,
      "currency": "INR",
      "pricing_category": "utility"
    },
    "sent_at": "2025-12-22T10:30:00Z"
  }
}

Code Examples

Node.js
const axios = require('axios');

const sendMessage = async () => {
  try {
    const response = await axios.post(
      'https://app.syncwaba.com/api/integrations/messages/send',
      {
        to: '+919876543210',
        type: 'template',
        templateName: 'welcome_message',
        templateVariables: {
          '1': 'John',
          '2': 'Premium Plan'
        },
        category: 'utility'
      },
      {
        headers: {
          'X-API-Key': 'sk_live_your_api_key_here',
          'Content-Type': 'application/json'
        }
      }
    );
    
    console.log('Message sent:', response.data);
  } catch (error) {
    console.error('Error:', error.response.data);
  }
};

sendMessage();
Python
import requests

def send_message():
    url = 'https://app.syncwaba.com/api/integrations/messages/send'
    headers = {
        'X-API-Key': 'sk_live_your_api_key_here',
        'Content-Type': 'application/json'
    }
    payload = {
        'to': '+919876543210',
        'type': 'template',
        'templateName': 'welcome_message',
        'templateVariables': {
            '1': 'John',
            '2': 'Premium Plan'
        },
        'category': 'utility'
    }
    
    response = requests.post(url, json=payload, headers=headers)
    print('Message sent:', response.json())

send_message()
PHP
<?php
$url = 'https://app.syncwaba.com/api/integrations/messages/send';
$data = [
    'to' => '+919876543210',
    'type' => 'template',
    'templateName' => 'welcome_message',
    'templateVariables' => [
        '1' => 'John',
        '2' => 'Premium Plan'
    ],
    'category' => 'utility'
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: sk_live_your_api_key_here',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>

Get Message Status

Track the delivery status of a sent message.

GET/api/integrations/messages/status/:messageId

Path Parameters

ParameterDescription
messageIdMessage ID returned from send message endpoint

Success Response (200 OK)

{
  "success": true,
  "data": {
    "message_id": "msg_1234567890abcdef",
    "status": "delivered",
    "to": "+919876543210",
    "sent_at": "2025-12-22T10:30:00Z",
    "delivered_at": "2025-12-22T10:30:15Z",
    "read_at": null,
    "template_name": "welcome_message",
    "cost": 0.115
  }
}

Message Status Values

sentMessage sent to WhatsApp servers
deliveredMessage delivered to recipient's device
readMessage read by recipient (blue ticks)
failedMessage delivery failed

🔔Webhooks

Webhooks allow you to receive real-time notifications about message events. Configure your webhook URL in Dashboard → Settings → Webhooks.

Webhook Configuration

  1. Create a webhook endpoint on your server (e.g., https://yoursite.com/webhooks/syncwaba)
  2. Configure the URL in SyncWABA Dashboard
  3. Verify endpoint responds with 200 OK
  4. Handle events based on event field

Webhook Events

message.sentMessage sent to WhatsApp servers
message.deliveredMessage delivered to recipient
message.readMessage read by recipient
message.failedMessage delivery failed
message.incomingReceived message from user
flow.submittedUser submitted WhatsApp Flow
flow.updatedFlow submission updated

Webhook Payload Format

{
  "event": "message.delivered",
  "timestamp": "2025-12-22T10:30:15Z",
  "data": {
    "message_id": "msg_1234567890abcdef",
    "recipient": "+919876543210",
    "status": "delivered",
    "delivered_at": "2025-12-22T10:30:15Z"
  }
}

Implementation Example (Node.js)

const express = require('express');
const app = express();

app.use(express.json());

app.post('/webhooks/syncwaba', async (req, res) => {
  const { event, timestamp, data } = req.body;
  
  // Handle different event types
  switch (event) {
    case 'message.delivered':
      console.log('Message delivered:', data.message_id);
      await updateMessageStatus(data.message_id, 'delivered');
      break;
      
    case 'message.incoming':
      console.log('Incoming message from:', data.from);
      await forwardToLiveChat(data);
      break;
      
    case 'flow.submitted':
      console.log('Flow submitted:', data.submission_id);
      await processFormData(data.form_data);
      break;
  }
  
  // Always respond with 200 OK
  res.status(200).json({ success: true });
});

app.listen(3000);
⚡

Important Notes

  • â€ĸ Your endpoint must respond within 5 seconds
  • â€ĸ Always return 200-299 status code
  • â€ĸ Process webhooks asynchronously (use queue)
  • â€ĸ Implement idempotency (check duplicate events)
  • â€ĸ We retry failed webhooks 3 times with exponential backoff

💰Message Pricing

WhatsApp message pricing varies by category. All prices are in Indian Rupees (INR).

Message CategoryPrice per MessageUse Case
Authentication₹0.115OTPs, password resets, account verification
Utility₹0.115Order updates, appointment reminders, alerts
Marketing₹0.7846Promotional campaigns, offers, newsletters
Service₹0 (Free)Replies within 24-hour window
💡

24-Hour Service Window

When a user messages you first, you have 24 hours to reply for FREE using service messages. After 24 hours, use template messages with appropriate categories.

âš ī¸Error Codes & Troubleshooting

HTTP Status Codes

200
OK
Request successful
400
Bad Request
Invalid request parameters
401
Unauthorized
Invalid or missing API key
403
Forbidden
API access not available on your plan
404
Not Found
Endpoint or resource not found
429
Too Many Requests
Rate limit exceeded
500
Internal Server Error
Server error, contact support

Common WhatsApp Error Codes

131047
Re-engagement Required
24-hour window expired. Send a template message.
Solution: Use a template message instead of text message
131026
Invalid Phone Number
Phone number format is incorrect or not on WhatsApp
Solution: Verify phone number is in E.164 format (+91XXXXXXXXXX)
133004
Template Not Found
Template name doesn't exist or not approved
Solution: Check template name spelling and approval status
131051
Unsupported Message Type
Message type not supported for this recipient
Solution: Check message type and recipient capabilities

đŸ’ŦSupport & Resources