Skip to main content
GET
/
whatsapp
/
phone_numbers
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const phoneNumberListResponse of client.whatsapp.phoneNumbers.list()) {
  console.log(phoneNumberListResponse.phone_number_id);
}
{
  "data": [
    {
      "record_type": "whatsapp_business_phone_number",
      "phone_number": "<string>",
      "phone_number_id": "<string>",
      "waba_id": "<string>",
      "user_id": "<string>",
      "display_name": "<string>",
      "quality_rating": "<string>",
      "status": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "enabled": true,
      "calling_enabled": true
    }
  ],
  "meta": {
    "total_pages": 3,
    "total_results": 55,
    "page_number": 2,
    "page_size": 25
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

page
object

Consolidated page parameter (deepObject style). Originally: page[number], page[size]

Response

Phone numbers

data
object[]
meta
object