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 (or owner-granted developer access)
- 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 | Every WhatsApp Business account linked to this token (legacy whatsAppAccountId plus UserWhatsAppAccountLink rows). Each: { id, wabaid, displayName } |
phoneNumbers | Numbers across all linked WABAs. Archived inventory rows are omitted. |
defaultPhoneNumberId | Set when there is exactly one listed number, otherwise the workspace primary line if that line is still in phoneNumbers, 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 |
isCoexisting | true when the line is WhatsApp Business App coexistence |
platformType | Meta platform type string when AvenPing has stored it, else null |
accountId | AvenPing WABA row id (matches accounts[].id) |
createdAt | ISO 8601 timestamp |
Workspaces can have multiple WABAs (TEAM and multi-line Cloud API setups). GET /v2/me returns every linked WABA in accounts and every non-archived number in phoneNumbers. 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=...). Archived numbers are not listed and cannot be used to send.
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,
"isCoexisting": false,
"platformType": "CLOUD_API",
"accountId": "clu01exampleaccountid01",
"createdAt": "2025-01-15T10:00:00.000Z"
},
{
"id": "clx01phoneinternal0002",
"phoneNumberId": "209876543210988",
"phoneNumber": "+15557654321",
"name": "Sales",
"isRegistered": true,
"isCoexisting": false,
"platformType": "CLOUD_API",
"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,
"isCoexisting": false,
"platformType": "CLOUD_API",
"accountId": "clu01exampleaccountid01",
"createdAt": "2025-01-15T10:00:00.000Z"
}
],
"defaultPhoneNumberId": "109876543210987"
}
}Response 200 (two WABAs — pick phoneNumberId / accountId per send):
json
{
"success": true,
"data": {
"user": {
"id": "clu01exampleuserid0001",
"email": "[email protected]"
},
"account": {
"id": "clu01exampleaccountid01",
"wabaid": "102290129012901"
},
"accounts": [
{
"id": "clu01exampleaccountid01",
"wabaid": "102290129012901",
"displayName": "Support WABA"
},
{
"id": "clu01exampleaccountid02",
"wabaid": "102290129012902",
"displayName": "Sales WABA"
}
],
"phoneNumbers": [
{
"id": "clx01phoneinternal0001",
"phoneNumberId": "109876543210987",
"phoneNumber": "+15551234567",
"name": "Support line",
"isRegistered": true,
"isCoexisting": false,
"platformType": "CLOUD_API",
"accountId": "clu01exampleaccountid01",
"createdAt": "2025-01-15T10:00:00.000Z"
},
{
"id": "clx01phoneinternal0003",
"phoneNumberId": "309876543210989",
"phoneNumber": "+15559876543",
"name": "Sales line",
"isRegistered": true,
"isCoexisting": false,
"platformType": "CLOUD_API",
"accountId": "clu01exampleaccountid02",
"createdAt": "2025-04-01T09:00:00.000Z"
}
],
"defaultPhoneNumberId": "109876543210987"
}
}FAQ
When is defaultPhoneNumberId set?
It is set when you have exactly one listed number, or when a workspace primary line is marked and that line is still in phoneNumbers. With multiple numbers and no usable primary, it is null — pick a phoneNumberId from phoneNumbers. Archived numbers are omitted from the list.
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).