WhatsApp accounts API
WhatsApp connection status API
Check whether one of your WhatsApp numbers is connected and ready to send messages. Use it before a campaign, or while waiting for a newly connected number to finish linking. Use this endpoint rather than /api/v1/whatsapp/status/<id>/, which doesn't work.
https://wbiztool.com/api/v1/whatsapp-client/status/Body: JSON or form fields
Quick example#
curl -X POST https://wbiztool.com/api/v1/whatsapp-client/status/ \
-H "Content-Type: application/json" \
-d '{
"client_id": 12345,
"api_key": "YOUR_API_KEY",
"whatsapp_client": 678
}'import requests
response = requests.post(
"https://wbiztool.com/api/v1/whatsapp-client/status/",
json={
"client_id": 12345,
"api_key": "YOUR_API_KEY",
"whatsapp_client": 678,
},
timeout=30,
)
result = response.json() # read the body even when the HTTP code is 400 or 403
if result["status"] == 1:
print("Connected")
elif result["message"] == "Disconnected":
print("Not connected. Reconnect it in WhatsApp settings.")
else:
print("Failed:", result["message"])// Node.js 18+ (built-in fetch). Save as .mjs to use top-level await.
const response = await fetch("https://wbiztool.com/api/v1/whatsapp-client/status/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
client_id: 12345,
api_key: "YOUR_API_KEY",
whatsapp_client: 678,
}),
});
const result = await response.json(); // read the body even when the HTTP code is 400 or 403
if (result.status === 1) {
console.log("Connected");
} else if (result.message === "Disconnected") {
console.log("Not connected. Reconnect it in WhatsApp settings.");
} else {
console.error("Failed:", result.message);
}<?php
$payload = [
'client_id' => 12345,
'api_key' => 'YOUR_API_KEY',
'whatsapp_client' => 678,
];
$ch = curl_init('https://wbiztool.com/api/v1/whatsapp-client/status/');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
if (($result['status'] ?? 0) === 1) {
echo 'Connected';
} elseif (($result['message'] ?? '') === 'Disconnected') {
echo 'Not connected. Reconnect it in WhatsApp settings.';
} else {
echo 'Failed: ' . ($result['message'] ?? 'no response');
}Replace 12345, YOUR_API_KEY and 678 with your own values. See Authentication for where to find them.
Request parameters#
client_idintegerrequiredYour API Client ID from Settings → API keys.
api_keystringrequiredYour API key from the same page.
whatsapp_clientintegerrequiredID of the WhatsApp number to check, from WhatsApp settings, List accounts or the
whatsapp_client_idreturned by Connect a number.
Using the official clients#
The Python client calls this endpoint for you.
from wbiztool_client import WbizToolClient
client = WbizToolClient(api_key="YOUR_API_KEY", client_id=12345)
result = client.get_whatsapp_client_status(678)
print(result)The Python client raises requests.exceptions.HTTPError when the API returns HTTP 400 or 403, so wrap the call in try/except.
The Node.js client's getWhatsAppClientStatus() calls an address that doesn't exist and fails with a 404. Use fetch as in the Quick example.
Response#
The request returns HTTP 200 with one of these bodies when your credentials are valid.
The number is connected:
{ "message": "Connected", "status": 1 }
The number isn't connected:
{ "message": "Disconnected", "status": 0 }
| Field | Type | Description |
|---|---|---|
status | integer | 1 if the number is connected. 0 if it isn't connected or the request failed. |
message | string | Connected, Disconnected, or the error. |
A number you deleted from WhatsApp settings also returns Disconnected.
Errors#
| Message | HTTP | How to fix it |
|---|---|---|
Auth Error | 200 | Send client_id, api_key and a numeric whatsapp_client in a POST body, as valid JSON or form fields. |
Invalid Client Id | 403 | Send client_id as a whole number, such as 12345. |
Auth Error: invalid api key | 400 | Check the key exists, hasn't been deleted and belongs to this client_id. |
Auth Error 2 | 200 | That whatsapp_client ID isn't in the workspace of this API key. |
Demo Account can not access apis | 200 | Use a regular account. |
Tips#
- Before sending: if the number you send from is disconnected, its messages wait in the queue until it reconnects or they expire, so check the status before large sends. Unsent messages on a disconnected number are removed after 90 days.
- After connecting a number: poll this endpoint every few seconds until it returns
Connected. Theconnectedwebhook can arrive a few seconds before this endpoint returnsConnected, so keep polling for up to a minute after the event. See Connect a number. - All numbers at once: to get the status of every number in one call, use List accounts.
