Developer Documentation

Enterprise-grade WhatsApp Business API integration for modern applications

RESTful Architecture
Webhook Events
Rate Limiting

Quick Start

Base URL:
https://api.messaging.com/v1
Authentication: Include your API key in the Authorization header as Bearer YOUR_API_KEY
Login to get your API key

Authentication

All API requests must include your API key in the Authorization header.

Header Format:
Authorization: Bearer YOUR_API_KEY
Keep your API key secret. Rotate immediately if exposed.

Sessions

Create Session
POST /api/whatsapp/sessions

Creates a new WhatsApp session and returns a QR code for scanning.

Request Body:
{
  "name": "My Session",
  "webhook": "https://your-site.com/webhook"
}
Response:
{
  "success": true,
  "data": {
    "sessionId": "session_123",
    "qrCode": "data:image/png;base64,..."
  }
}
cURL Example:
curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"My Session"}' \
  https://api.messaging.com/api/whatsapp/sessions

Messages

Send Message
POST /api/whatsapp/sessions/{sessionId}/messages

Sends a WhatsApp message to the specified number.

Parameters:
  • sessionId (string, required) - Session ID in URL path
  • to (string, required) - Recipient phone number
  • message (string, required) - Message text
Request Body:
{
  "to": "+1234567890",
  "message": "Hello from WhatsApp API!"
}
cURL Example:
curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"+1234567890","message":"Hello World!"}' \
  https://api.messaging.com/api/whatsapp/sessions/session_123/messages

Webhooks

Receive real-time message events by configuring webhook URLs in your dashboard.

Supported Events:
  • message.received - New message received
  • message.sent - Message sent successfully
  • message.delivered - Message delivered
  • session.connected - Session connected
  • session.disconnected - Session disconnected
Sample Webhook Payload:
{
  "event": "message.delivered",
  "data": {
    "id": "msg_001",
    "sessionId": "session_123",
    "to": "+1234567890",
    "message": "Hello World!",
    "timestamp": "2025-09-30T01:16:25Z"
  }
}

Code Examples

// Send a WhatsApp message
const response = await fetch('/api/whatsapp/sessions/session_123/messages', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    to: '+1234567890',
    message: 'Hello from JavaScript!'
  })
});

const result = await response.json();
console.log(result);
import requests

# Send a WhatsApp message
url = "https://api.messaging.com/api/whatsapp/sessions/session_123/messages"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "to": "+1234567890",
    "message": "Hello from Python!"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
 "+1234567890",
    "message" => "Hello from PHP!"
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

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

echo $response;
?>
curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"+1234567890","message":"Hello from cURL!"}' \
  https://api.messaging.com/api/whatsapp/sessions/session_123/messages