Skip to content
Wbiztool

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.

POSThttps://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
  }'

Replace 12345, YOUR_API_KEY and 678 with your own values. See Authentication for where to find them.

Request parameters#

client_idintegerrequired

Your API Client ID from Settings → API keys.

api_keystringrequired

Your API key from the same page.

whatsapp_clientintegerrequired

ID of the WhatsApp number to check, from WhatsApp settings, List accounts or the whatsapp_client_id returned by Connect a number.

Using the official clients#

The Python client calls this endpoint for you.

Python
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 }
FieldTypeDescription
statusinteger1 if the number is connected. 0 if it isn't connected or the request failed.
messagestringConnected, Disconnected, or the error.

A number you deleted from WhatsApp settings also returns Disconnected.

Errors#

MessageHTTPHow to fix it
Auth Error200Send client_id, api_key and a numeric whatsapp_client in a POST body, as valid JSON or form fields.
Invalid Client Id403Send client_id as a whole number, such as 12345.
Auth Error: invalid api key400Check the key exists, hasn't been deleted and belongs to this client_id.
Auth Error 2200That whatsapp_client ID isn't in the workspace of this API key.
Demo Account can not access apis200Use 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. The connected webhook can arrive a few seconds before this endpoint returns Connected, 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.