🎉 Get started with a free trial of Whabus WhatsApp API & Shared Inbox! Just ₹800/number. Start Free Trial →
REST API v1

Whabus Developer API Documentation

High-speed WhatsApp Web messaging, media delivery, webhooks, and session telemetry.

Base URL: https://whabus.in/api/ Get API Key

1. Overview & Base URL

The Whabus REST API provides standard JSON endpoints for dispatching outgoing WhatsApp messages, inspecting conversation histories, and streaming incoming events.

Base URL: https://whabus.in/api/

Every connected WhatsApp number in your Whabus account has its own unique Bearer token. All requests must be sent over HTTPS.

2. Authentication

Authenticate all API requests by providing your token in the HTTP Authorization header:

Authorization: Bearer YOUR_API_TOKEN
Never expose your API keys in client-side code, public GitHub repositories, or frontend scripts.

3. Rate Limits & Idempotency

To maintain high session quality and comply with carrier standards, each connected number has a rate limit of 120 requests per minute by default. If exceeded, the API responds with 429 Too Many Requests and a Retry-After header.

Idempotency: Include an X-Idempotency-Key: <uuid> header to prevent duplicate message sends when retrying transient network errors.

4. Send Text Message

POST /api/send-message

Queues and dispatches an outbound text message to a specific WhatsApp recipient.

curl -X POST "https://whabus.in/api/send-message" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "text": "Hello! Your order #9821 has been shipped."
  }'
<?php
$ch = curl_init("https://whabus.in/api/send-message");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    "to" => "+919876543210",
    "text" => "Hello! Your order #9821 has been shipped."
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer YOUR_API_TOKEN",
    "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
const response = await fetch("https://whabus.in/api/send-message", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    to: "+919876543210",
    text: "Hello! Your order #9821 has been shipped."
  })
});
const data = await response.json();
console.log(data);
Response (200 OK)
{
  "success": true,
  "message": "Message queued successfully",
  "data": {
    "message_id": "msg_9f82d1c8e0a4",
    "status": "queued",
    "to": "+919876543210",
    "timestamp": 1732075200
  }
}

5. Send Image

POST /api/send-image
curl -X POST "https://whabus.in/api/send-image" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "url": "https://example.com/invoice-receipt.png",
    "caption": "Your payment receipt for Invoice #8291"
  }'

6. Send Document / PDF

POST /api/send-document
curl -X POST "https://whabus.in/api/send-document" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "url": "https://example.com/policy-document.pdf",
    "filename": "whabus_policy.pdf",
    "caption": "Please find attached the policy terms."
  }'

7. Send Video & Audio

POST /api/send-video POST /api/send-audio

Supports MP4, MP3, and OGG voice note streaming.

8. Send Location & Contact

POST /api/send-location POST /api/send-contact
// Send Location
{
  "to": "+919876543210",
  "latitude": 12.9716,
  "longitude": 77.5946,
  "name": "Whabus Bangalore HQ",
  "address": "MG Road, Bangalore, Karnataka"
}

9. Messages & Chats Telemetry

GET /api/messages - List paginated message history
GET /api/messages/{id} - Retrieve message details
GET /api/chats - List conversations
GET /api/session/status - Check live connection status

10. Groups & Participants

GET /api/groups
GET /api/groups/{id}
GET /api/groups/{id}/participants

11. Webhooks & Event Streaming

Register a webhook URL via the Customer Portal or API (POST /api/webhooks). Whabus pushes real-time HTTP POST notifications with the following headers:

X-Whabus-Event: message.received
X-Whabus-Signature: <HMAC-SHA256 signature calculated with your webhook secret>
X-Whabus-Delivery: <unique delivery uuid>
Supported Webhook Events:
  • message.received - Triggered when a WhatsApp customer sends a message.
  • message.sent - Triggered when a message is dispatched through the API.
  • message.delivered - Triggered on double-tick delivery confirmation.
  • message.read - Triggered on blue-tick read confirmation.
  • session.connected / session.disconnected - Session lifecycle changes.

12. Error Codes

HTTP Status Meaning Description
200 OK Success Request succeeded and message was queued or processed.
401 Unauthorized Auth Failed Missing, invalid, or revoked Bearer token.
402 Payment Required Subscription Expired Active subscription required to access the API.
422 Unprocessable Validation Error Recipient number is missing or in an invalid format.
429 Too Many Requests Rate Limit Exceeded Exceeded 120 requests/minute. Slow down requests.
500 Server Error Internal Error Something went wrong on the WhatsApp connection daemon.