Appearance
Accounts
List the WhatsApp phone numbers connected to your Watzy account. You'll need an account_id from this endpoint when sending messages.
GET /api/v1/accounts
Returns all active WhatsApp accounts (phone numbers) linked to your API key.
Request
http
GET /api/v1/accounts HTTP/1.1
Authorization: Bearer wzy_your_key_hereResponse
json
{
"data": [
{
"id": 1,
"phone_number_id": "123456789012345",
"display_phone_number": "+1 555 123 4567",
"waba_id": "987654321098765",
"status": "active"
},
{
"id": 2,
"phone_number_id": "543210987654321",
"display_phone_number": "+44 20 1234 5678",
"waba_id": "987654321098765",
"status": "active"
}
]
}Response fields
| Field | Type | Description |
|---|---|---|
id | integer | Use this as account_id when sending messages |
phone_number_id | string | Meta's internal phone number ID |
display_phone_number | string | Human-readable phone number |
waba_id | string | WhatsApp Business Account ID |
status | string | active or inactive |
Example — curl
bash
curl https://whatsapp-backend.developnetwork.net/api/v1/accounts \
-H "Authorization: Bearer wzy_your_key_here"Example — JavaScript
js
const res = await fetch('https://whatsapp-backend.developnetwork.net/api/v1/accounts', {
headers: { 'Authorization': 'Bearer wzy_your_key_here' },
})
const { data: accounts } = await res.json()
// Pick the first account's id for sending messages
const accountId = accounts[0].id