List WhatsApp phone numbers with GET /v2/me
Call GET /v2/me with your AvenPing API token to list linked WhatsApp Business accounts and every Meta phoneNumberId. Use those IDs when sending messages or templates.
Base: /v2/me
Auth + Premium/Enterprise + active plan required (see overview — Access rules). Does not require phoneNumberId in the request.
Also read: HTTP API v2 Overview
Prerequisites
- An API token from Settings → API Settings (Authentication)
- Premium or Enterprise with an active plan
- A WhatsApp Business account linked in AvenPing
Step-by-step
Send the auth header
CallGET https://api.avenping.com/v2/mewithAuthorization: Bearer YOUR_TOKENorX-API-Token: YOUR_TOKEN.Confirm the workspace has a linked WABA
If no WhatsApp account with a Meta access token is linked, the API returns404 NOT_FOUND(WhatsApp account not found).Read phoneNumbers and defaultPhoneNumberId
Copy MetaphoneNumberIdvalues fromdata.phoneNumbers. UsedefaultPhoneNumberIdwhen it is set (exactly one number, or the workspace primary line).Use those IDs on send and list routes
PassphoneNumberIdon messages, template send, and media upload. OnGET /v2/templatesandGET /v2/forms, optionalphoneNumberIdoraccountIdselects a linked WABA. Ownership is checked against every linked account, not onlydata.account.
GET /v2/me
Returns the user and WhatsApp account context for the token, and all phone numbers linked to that account (for choosing phoneNumberId on Messages and Templates sends).
Field in data | Description |
|---|---|
user | { id, email } |
account | { id, wabaid } — default WhatsApp Business Account used when you omit a WABA selector |
accounts | All WhatsApp Business accounts linked to this token. Each: { id, wabaid, displayName } |
phoneNumbers | Numbers registered in AvenPing across all linked accounts |
defaultPhoneNumberId | Set when there is exactly one number, otherwise the workspace primary line if one is marked, otherwise null |
Each element of phoneNumbers:
| Field | Description |
|---|---|
id | AvenPing internal id (cuid) |
phoneNumberId | Meta Phone number ID — use this in message/template bodies |
phoneNumber | Display / E.164-style number string |
name | Optional label |
isRegistered | Registration flag from AvenPing DB |
accountId | AvenPing WABA row id (matches accounts[].id) |
createdAt | ISO 8601 timestamp |
Workspaces can have multiple WABAs. phoneNumberId on send/upload routes is checked against every linked account, not only data.account. Use accounts and each phone’s accountId when you need to list templates or flows for a specific WABA (GET /v2/templates?phoneNumberId=... or ?accountId=...).
Example request:
bash
curl -sS "https://api.avenping.com/v2/me" \
-H "Authorization: Bearer YOUR_TOKEN"Response 200 (two numbers — defaultPhoneNumberId is null):
json
{
"success": true,
"data": {
"user": {
"id": "clu01exampleuserid0001",
"email": "[email protected]"
},
"account": {
"id": "clu01exampleaccountid01",
"wabaid": "102290129012901"
},
"accounts": [
{
"id": "clu01exampleaccountid01",
"wabaid": "102290129012901",
"displayName": "Support WABA"
}
],
"phoneNumbers": [
{
"id": "clx01phoneinternal0001",
"phoneNumberId": "109876543210987",
"phoneNumber": "+15551234567",
"name": "Support line",
"isRegistered": true,
"accountId": "clu01exampleaccountid01",
"createdAt": "2025-01-15T10:00:00.000Z"
},
{
"id": "clx01phoneinternal0002",
"phoneNumberId": "209876543210988",
"phoneNumber": "+15557654321",
"name": "Sales",
"isRegistered": true,
"accountId": "clu01exampleaccountid01",
"createdAt": "2025-03-01T14:30:00.000Z"
}
],
"defaultPhoneNumberId": null
}
}Response 200 (single number — default set):
json
{
"success": true,
"data": {
"user": {
"id": "clu01exampleuserid0001",
"email": "[email protected]"
},
"account": {
"id": "clu01exampleaccountid01",
"wabaid": "102290129012901"
},
"accounts": [
{
"id": "clu01exampleaccountid01",
"wabaid": "102290129012901",
"displayName": "Support WABA"
}
],
"phoneNumbers": [
{
"id": "clx01phoneinternal0001",
"phoneNumberId": "109876543210987",
"phoneNumber": "+15551234567",
"name": null,
"isRegistered": true,
"accountId": "clu01exampleaccountid01",
"createdAt": "2025-01-15T10:00:00.000Z"
}
],
"defaultPhoneNumberId": "109876543210987"
}
}FAQ
When is defaultPhoneNumberId set?
It is set when you have exactly one number, or when a workspace primary line is marked. With multiple numbers and no primary, it is null — pick a phoneNumberId from phoneNumbers.
Can I send from any linked WABA?
Yes. phoneNumberId on send/upload is checked against every linked account, not only data.account. Use accounts and each phone’s accountId to target a specific WABA on list routes (?phoneNumberId= or ?accountId=).
Why do I get 404 on GET /v2/me?
A valid token still requires a linked WhatsApp account with a Meta access token. Otherwise the API returns 404 NOT_FOUND (WhatsApp account not found).