📱 Multi-Account WhatsApp API

Complete REST API for WhatsApp Business with multi-account support using Bhaukaal library

🚀 Open Web Interface

Use the web interface to create accounts and connect to WhatsApp

🚀 Quick Start

  1. Create an account: POST /account/create
  2. Connect to WhatsApp: POST /account/connect (with token)
  3. Get QR code: GET /account/qr or use pairing code
  4. Start sending messages with your token!
⚠️ Important: Every account has a unique API token. You must include this token in the X-API-Token header for all API calls.

🔐 Authentication

Include your API token in every request:
X-API-Token: your_api_token_here
Or in Authorization header: Authorization: Bearer your_api_token_here

📋 Account Management

POST/account/create

Headers: X-Master-Token: your_master_token

Create 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"
  }
}

POST/account/connect

Start WhatsApp connection process

Headers: X-API-Token: your_token
Response: Connection initiated message

GET/account/qr

Get QR code to scan with WhatsApp mobile app

Headers: X-API-Token: your_token

POST/account/pairing

Get pairing code instead of QR

Headers: X-API-Token: your_token
Body: { "phone_number": "1234567890" }

GET/account/status

Check connection status

Headers: X-API-Token: your_token

GET/account/messages

Get received messages

Headers: X-API-Token: your_token
Query Params: limit=50 (optional, default: 50)
Response:
{
  "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
    }
  ]
}

DELETE/account/messages

Clear received messages history

Headers: X-API-Token: your_token
Response: { "success": true, "message": "Messages cleared successfully" }

💬 Send Messages

POST/send-text

Send text message

Headers: X-API-Token: your_token
Body:
{
  "to": "[email protected]",
  "text": "Hello from API!"
}

POST/send-image

Body:
{
  "to": "[email protected]",
  "image_path": "https://example.com/image.jpg",
  "caption": "Optional caption"
}

POST/send-video

Body: to, video_path, caption (optional)

POST/send-audio

Body: to, audio_path, ptt (voice note: true/false)

POST/send-document

Body: to, file_path, file_name, mimetype

POST/send-location

Body: to, latitude, longitude

POST/send-contact

Body: to, contact_name, contact_number

POST/send-poll

Body:
{
  "to": "[email protected]",
  "poll_name": "Favorite color?",
  "options": ["Red", "Blue", "Green"],
  "selectable_count": 1
}

POST/send-list

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" }
      ]
    }
  ]
}

👥 Group Management

POST/group/create

Body:
{
  "name": "My Group",
  "participants": ["[email protected]"]
}

GET/group/info/:groupId

Get group metadata

GET/group/invite/:groupId

Get group invite link

POST/group/participants/add

Body: group_id, participants (array)

POST/group/participants/remove

Body: group_id, participants (array)

🔧 Utility Endpoints

POST/check-number

Check if a number exists on WhatsApp

Body: { "number": "1234567890" }

GET/profile-pic/:jid

Get profile picture URL

📝 JID Format

💡 Tips

🔒 Security Note: Keep your API tokens secure. Anyone with your token can send messages on behalf of your account.