Skip to content
Wbiztool

WhatsApp accounts API

List connected WhatsApp numbers API

Get the WhatsApp numbers in your workspace that are connected right now. Use it to let users pick which number to send from, or to find the whatsapp_client ID for other API calls.

POSThttps://wbiztool.com/api/v1/whatsapp-client/list/

Body: JSON or form fields

Only connected numbers are returned. To also see numbers that are disconnected, use List accounts.

Quick example#

curl -X POST https://wbiztool.com/api/v1/whatsapp-client/list/ \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": 12345,
    "api_key": "YOUR_API_KEY"
  }'

Replace 12345 and YOUR_API_KEY 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. The list is for the workspace this key was created in.

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.list_whatsapp_clients()
for number in result.get("whatsapp_clients", []):
    print(number["whatsapp_client_id"], number["whatsapp_client_number"])

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 getWhatsAppClients() calls an address that doesn't exist and fails with a 404. Use fetch as in the Quick example.

Response#

A successful request returns HTTP 200:

{
  "message": "okay",
  "whatsapp_clients": [
    {
      "id": 678,
      "whatsapp_client_id": 678,
      "whatsapp_client_number": "919876543210",
      "is_connected": true
    }
  ],
  "status": 1
}
FieldTypeDescription
statusinteger1 on success, 0 if the request failed.
messagestringokay on success, otherwise the error.
whatsapp_clientsarrayYour connected numbers. Empty if none are connected. Only present on success.
whatsapp_clients[].whatsapp_client_idintegerThe number's ID. Pass it as whatsapp_client in other API calls.
whatsapp_clients[].idintegerSame value as whatsapp_client_id.
whatsapp_clients[].whatsapp_client_numberstringThe phone number as it was saved when the number was added.
whatsapp_clients[].is_connectedbooleanAlways true, because only connected numbers are listed.

The list isn't sorted in any guaranteed order. Sort by whatsapp_client_id if order matters.

Errors#

MessageHTTPHow to fix it
Auth Error200Send both client_id and api_key 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.

A request that isn't a POST returns an empty object {}. An unexpected server problem returns HTTP 500 with an HTML body, so check that the response is JSON before reading status.

Tips#

  • Empty list: "whatsapp_clients": [] means no number is connected in this workspace. Connect one in WhatsApp settings or with Connect a number.
  • Several workspaces: the API key decides which workspace is listed. Use a key created in the workspace you want.
  • One number only: to check a single number, use Connection status.