Phone Numbers
Retrieve all WhatsApp Business phone numbers associated with your account. These phone numbers are used as the sender for your WhatsApp messages.
Fetch Phone Numbers
Retrieve all phone numbers mapped to your account.
Endpoint
GET /v1/phone_number_ids
Request
curl -X GET "https://whatsapp.smsleopard.com/v1/phone_number_ids" \
-H "Authorization: Basic <your_credentials>" \
-H "Content-Type: application/json"
Response
[
{
"id": 1,
"business_account_id": 1,
"phone_number": "+254700000000",
"phone_number_id": "46646XXXXXXX268",
"whatsapp_account_id": "43082XXXXXXX064",
"messaging_limit": 0
}
]
Response Fields
Field | Type | Description |
---|---|---|
id | integer | Internal ID for the phone number record |
business_account_id | integer | Your WhatsApp Business Account ID |
phone_number | string | The phone number in international format |
phone_number_id | string | WhatsApp's unique identifier for this phone number |
whatsapp_account_id | string | WhatsApp Account ID associated with this number |
messaging_limit | integer | Current messaging limit (0 = no limit) |
Phone Number ID Usage
The phone_number_id
is crucial for sending messages. You'll need this ID when:
- Fetching templates for a specific phone number
- Sending WhatsApp messages
- Managing phone number specific settings
Each WhatsApp Business phone number has a unique id
that you'll
use in subsequent API calls, not to be confused with phone_number_id
.
Error Response Shape
The API returns a consistent error response shape for all errors:
{
"error_code": string, // e.g., "bad_request", "invalid_format", "unauthorized"
"error_message": string, // actual error message describing the issue
"status_code": integer // e.g., 400, 401, 404, 500
}
Next Steps
Once you have your phone number IDs: