WhatsApp APIAPI

WhatsApp: list the numbers

List the workspace WhatsApp numbers connected through Meta's official API and get the id that goes in numberId when sending.

Updated on

GET /whatsapp/numbers returns the workspace WhatsApp numbers. The id of each one goes in numberId when sending templates and messages.

List the numbers

GET https://api.xbase.app/api/external/v1/whatsapp/numbers
curl https://api.xbase.app/api/external/v1/whatsapp/numbers \
  -H "Authorization: Bearer $XBASE_API_KEY"

Response 200:

[
  {
    "id": "6d1f3c2a-4b5e-4f60-9a7b-8c9d0e1f2a3b",
    "phone": "5511999990000",
    "name": "Customer service",
    "status": "ACTIVE"
  }
]
FieldTypeDescription
idtextNumber id at XBASE. Goes in numberId
phonetext or nullSending number, digits only, with the country code
nametext or nullDisplay name of the number
statustextACTIVE sends. INACTIVE is disconnected: sends through it return 422 NUMBER_DISCONNECTED

The list comes in the order the numbers were connected. A number removed in WhatsApp API → Numbers does not show up.

Errors

StatuscodeWhen
401INVALID_API_KEYNo key, wrong key format, nonexistent or revoked key
403MISSING_SCOPEThe key does not have the whatsapp:send scope

See the full format in Errors.

Frequently asked questions

See also

On this page