Complete REST API for WhatsApp Business with multi-account support using Bhaukaal library
Use the web interface to create accounts and connect to WhatsApp
POST /account/createPOST /account/connect (with token)GET /account/qr or use pairing codeX-API-Token header for all API calls.
X-API-Token: your_api_token_hereAuthorization: Bearer your_api_token_here
X-Master-Token: your_master_tokenCreate a new account and get API token
Request Body:{
"phone_number": "1234567890"
}
Response:
{
"success": true,
"data": {
"account_id": "uuid",
"phone_number": "1234567890",
"api_token": "your-unique-token",
"status": "disconnected"
}
}
Start WhatsApp connection process
Headers:X-API-Token: your_tokenGet QR code to scan with WhatsApp mobile app
Headers:X-API-Token: your_token
Get pairing code instead of QR
Headers:X-API-Token: your_token{ "phone_number": "1234567890" }
Check connection status
Headers:X-API-Token: your_token
Get received messages
Headers:X-API-Token: your_tokenlimit=50 (optional, default: 50){
"success": true,
"account_id": "uuid",
"count": 10,
"messages": [
{
"messageId": "msg_id",
"from": "[email protected]",
"fromName": "John Doe",
"text": "Hello!",
"timestamp": "2025-12-03T10:30:00.000Z",
"type": "conversation",
"isGroup": false
}
]
}
Clear received messages history
Headers:X-API-Token: your_token{ "success": true, "message": "Messages cleared successfully" }
Send text message
Headers:X-API-Token: your_token{
"to": "[email protected]",
"text": "Hello from API!"
}
{
"to": "[email protected]",
"image_path": "https://example.com/image.jpg",
"caption": "Optional caption"
}
to, video_path, caption (optional)
to, audio_path, ptt (voice note: true/false)
to, file_path, file_name, mimetype
to, latitude, longitude
to, contact_name, contact_number
{
"to": "[email protected]",
"poll_name": "Favorite color?",
"options": ["Red", "Blue", "Green"],
"selectable_count": 1
}
Send interactive list message (dropdown menu)
Body:{
"to": "[email protected]",
"title": "Menu",
"description": "Choose an option",
"button_text": "Click Here",
"sections": [
{
"title": "Section 1",
"rows": [
{ "title": "Option 1", "rowId": "opt1", "description": "First option" },
{ "title": "Option 2", "rowId": "opt2", "description": "Second option" }
]
}
]
}
{
"name": "My Group",
"participants": ["[email protected]"]
}
Get group metadata
Get group invite link
group_id, participants (array)
group_id, participants (array)
Check if a number exists on WhatsApp
Body:{ "number": "1234567890" }
Get profile picture URL
[email protected][email protected]