Skip to content
Wbiztool

WhatsApp accounts API

List WhatsApp accounts API

Use this API to get a complete list of all your WhatsApp numbers and their connection status, in one call. Unlike List connected numbers, it includes numbers that are disconnected.

POSThttps://wbiztool.com/api/v1/whatsapp/accounts/

Body: JSON or form fields

DifferenceList accountsList connected numbers
Includes disconnected and deleted numbersYesNo
Item keyswhatsapp_client_id, whatsapp_number, statusid, whatsapp_client_id, whatsapp_client_number, is_connected
message on successNot includedokay

Quick example#

curl -X POST https://wbiztool.com/api/v1/whatsapp/accounts/ \
  -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.

Neither official client has a method for this endpoint, so call it directly as in the examples.

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.

Response#

A successful request returns HTTP 200:

{
  "whatsapp_clients": [
    {
      "whatsapp_client_id": 678,
      "whatsapp_number": "919876543210",
      "status": "connected"
    },
    {
      "whatsapp_client_id": 702,
      "whatsapp_number": "919812345678",
      "status": "not_connected"
    }
  ],
  "status": 1
}
FieldTypeDescription
statusinteger1 on success, 0 if the request failed.
whatsapp_clientsarrayEvery WhatsApp number ever added to this workspace. Only present on success.
whatsapp_clients[].whatsapp_client_idintegerThe number's ID. Pass it as whatsapp_client in other API calls.
whatsapp_clients[].whatsapp_numberstringThe phone number as it was saved when it was added.
whatsapp_clients[].statusstringconnected or not_connected.

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

A successful response has no message field, so read it with a fallback as in the examples.

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.

If the server hits an unexpected problem, or the request isn't a POST, the response is an empty object: {}. Treat a missing status as a failure.

Tips#

  • Reconnecting a number: a not_connected number can be reconnected in WhatsApp settings or with Connect a number.
  • One number only: to check a single number, use Connection status.
  • Several workspaces: the API key decides which workspace is listed. Use a key created in the workspace you want.