import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.phoneNumbers.slimList();
console.log(response.data);{
"data": [
{
"id": "1293384261075731499",
"record_type": "phone_number",
"phone_number": "+19705555098",
"country_iso_alpha2": "US",
"status": "active",
"external_pin": "1234",
"connection_id": "1293384261075731499",
"customer_reference": "customer-reference",
"billing_group_id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
"emergency_enabled": true,
"emergency_address_id": "1315261609962112019",
"emergency_status": "active",
"call_forwarding_enabled": true,
"cnam_listing_enabled": true,
"caller_id_name_enabled": true,
"call_recording_enabled": true,
"t38_fax_gateway_enabled": true,
"phone_number_type": "local",
"inbound_call_screening": "disabled",
"purchased_at": "2019-10-23T18:10:00.000Z",
"created_at": "2019-10-23T18:10:00.000Z",
"updated_at": "2019-10-24T18:10:00.000Z",
"hd_voice_enabled": true
}
],
"meta": {
"page_number": 2,
"page_size": 25,
"total_pages": 3,
"total_results": 55
}
}List phone numbers, This endpoint is a lighter version of the /phone_numbers endpoint having higher performance and rate limit.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const response = await client.phoneNumbers.slimList();
console.log(response.data);{
"data": [
{
"id": "1293384261075731499",
"record_type": "phone_number",
"phone_number": "+19705555098",
"country_iso_alpha2": "US",
"status": "active",
"external_pin": "1234",
"connection_id": "1293384261075731499",
"customer_reference": "customer-reference",
"billing_group_id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
"emergency_enabled": true,
"emergency_address_id": "1315261609962112019",
"emergency_status": "active",
"call_forwarding_enabled": true,
"cnam_listing_enabled": true,
"caller_id_name_enabled": true,
"call_recording_enabled": true,
"t38_fax_gateway_enabled": true,
"phone_number_type": "local",
"inbound_call_screening": "disabled",
"purchased_at": "2019-10-23T18:10:00.000Z",
"created_at": "2019-10-23T18:10:00.000Z",
"updated_at": "2019-10-24T18:10:00.000Z",
"hd_voice_enabled": true
}
],
"meta": {
"page_number": 2,
"page_size": 25,
"total_pages": 3,
"total_results": 55
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Include the connection associated with the phone number.
Include the tags associated with the phone number.
Specifies the sort order for results. If not given, results are sorted by created_at in descending order.
purchased_at, phone_number, connection_name, usage_payment_method "connection_name"
Consolidated filter parameter (deepObject style). Originally: filter[tag], filter[phone_number], filter[status], filter[country_iso_alpha2], filter[connection_id], filter[voice.connection_name], filter[voice.usage_payment_method], filter[billing_group_id], filter[emergency_address_id], filter[customer_reference], filter[number_type], filter[source]
Show child attributes
Filter by phone number tags. (This requires the include_tags param)
Filter by phone number. Requires at least three digits. Non-numerical characters will result in no values being returned.
Filter by phone number status.
purchase-pending, purchase-failed, port_pending, active, deleted, port-failed, emergency-only, ported-out, port-out-pending "active"
Filter by phone number country ISO alpha-2 code. Can be a single value or an array of values.
"US"
Filter by connection_id.
"1521916448077776306"
Filter by voice connection name pattern matching (requires include_connection param).
Show child attributes
Filter contains connection name. Requires at least three characters and the include_connection param.
"test"
Filter starts with connection name. Requires at least three characters and the include_connection param.
"test"
Filter ends with connection name. Requires at least three characters and the include_connection param.
"test"
Filter by connection name.
"test"
Filter by usage_payment_method.
pay-per-minute, channel "channel"
Filter by the billing_group_id associated with phone numbers. To filter to only phone numbers that have no billing group associated them, set the value of this filter to the string 'null'.
"62e4bf2e-c278-4282-b524-488d9c9c43b2"
Filter by the emergency_address_id associated with phone numbers. To filter only phone numbers that have no emergency address associated with them, set the value of this filter to the string 'null'.
"9102160989215728032"
Filter numbers via the customer_reference set.
Filter phone numbers by their source. Use 'ported' for numbers ported from other carriers, or 'purchased' for numbers bought directly from Telnyx.
ported, purchased Successful response with a list of phone numbers.
Show child attributes
Identifies the resource.
"1293384261075731499"
Identifies the type of the resource.
"phone_number_slim"
The +E.164-formatted phone number associated with this record.
The ISO 3166-1 alpha-2 country code of the phone number.
"US"
The phone number's current status.
purchase-pending, purchase-failed, port-pending, port-failed, active, deleted, emergency-only, ported-out, port-out-pending, requirement-info-pending, requirement-info-under-review, requirement-info-exception, provision-pending If someone attempts to port your phone number away from Telnyx and your phone number has an external PIN set, Telnyx will attempt to verify that you provided the correct external PIN to the winning carrier. Note that not all carriers cooperate with this security mechanism.
Identifies the connection associated with the phone number.
A customer reference string for customer look ups.
"MY REF 001"
Identifies the billing group associated with the phone number.
Indicates whether emergency services are enabled for this number.
Identifies the emergency address associated with the phone number.
Indicates the status of the provisioning of emergency services for the phone number. This field contains information about activity that may be ongoing for a number where it either is being provisioned or deprovisioned but is not yet enabled/disabled.
active, deprovisioning, disabled, provisioning, provisioning-failed Indicates if call forwarding will be enabled for this number if forwards_to and forwarding_type are filled in. Defaults to true for backwards compatibility with APIV1 use of numbers endpoints.
Indicates whether a CNAM listing is enabled for this number.
Indicates whether caller ID is enabled for this number.
Indicates whether call recording is enabled for this number.
Indicates whether T38 Fax Gateway for inbound calls to this number.
ISO 8601 formatted date indicating when the resource was purchased.
ISO 8601 formatted date indicating when the resource was created.
The phone number's type.
Note: For numbers purchased prior to July 2023 or when fetching a number's details immediately after a purchase completes, the legacy values tollfree, shortcode or longcode may be returned instead.
local, toll_free, mobile, national, shared_cost, landline, tollfree, shortcode, longcode The inbound_call_screening setting is a phone number configuration option variable that allows users to configure their settings to block or flag fraudulent calls. It can be set to disabled, reject_calls, or flag_calls. This feature has an additional per-number monthly cost associated with it.
disabled, reject_calls, flag_calls Was this page helpful?