WPMsg
WPMsg
Sign in Get started
Developer Docs

WPMsg REST API

Send WhatsApp messages, check connection status, and monitor usage from any language using simple HTTP requests.

Authentication

Every API request must include your API key. Generate one from your dashboard at https://wpmsg.bd1b.com/api-key.

HTTP header
X-API-KEY: sk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Or as Bearer token
Authorization: Bearer sk_live_XXXX...
Base URL
https://wpmsg.bd1b.com/api/v1

Endpoints Overview

Method Path
POST /api/v1/sms
GET /api/v1/status
GET /api/v1/account
GET /api/v1/balance
GET /api/v1/logs

Send SMS

POST https://wpmsg.bd1b.com/api/v1/sms

Request body

Field Type Required
tostringYes
messagestringYes
account_idstringNo

Example — cURL

curl -X POST https://wpmsg.bd1b.com/api/v1/sms \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"8801XXXXXXXXX","message":"Hello world"}'

Example — PHP

<?php
$ch = curl_init("https://wpmsg.bd1b.com/api/v1/sms");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['X-API-KEY: YOUR_API_KEY', 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode([
    'to' => '8801XXXXXXXXX',
    'message' => 'Hello from API',
  ]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;

Success response

{
  "success": true,
  "message_id": "3EB0A1B2C3D4E5F6",
  "timestamp": 1790497398000,
  "remaining_messages": 499
}

Connection Status

GET https://wpmsg.bd1b.com/api/v1/status
{
  "success": true,
  "connected": true,
  "phone": "8801XXXXXXXXX",
  "name": "Your Profile",
  "last_seen": 1790497398000
}

Account Info

GET https://wpmsg.bd1b.com/api/v1/account
{
  "success": true,
  "account": {
    "phone": "8801XXXXXXXXX",
    "name": "Your Profile",
    "jid": "8801XXXXXXXXX:5@s.whatsapp.net"
  }
}

Balance & Plan Usage

GET https://wpmsg.bd1b.com/api/v1/balance
{
  "success": true,
  "wallet_balance": 550.00,
  "plan": {
    "name": "Starter",
    "limit": 500,
    "used": 42,
    "remaining": 458,
    "ends_at": "2026-10-27T00:00:00+06:00"
  }
}

Message Logs

GET https://wpmsg.bd1b.com/api/v1/logs

Query parameters: per_page (default 25, max 100), status (sent|failed), page.

Error Codes

HTTP Error
401 missing_api_key
401 invalid_api_key
403 account_banned
403 no_active_plan
403 message_limit_exceeded
422 validation_failed
422 no_whatsapp_account
502 not_connected
500 send_failed

Need an API key?

Sign in to your dashboard to generate, rotate, and manage API keys.

Sign in to continue