Successful response with a list of phone numbers.
Array of objects (PhoneNumberDetailed) | |
object (PaginationMeta) |
import telnyx telnyx.api_key = "YOUR_API_KEY" telnyx.PortingPhoneNumber.list(page: { numbner: 1, size: 20})
{- "data": [
- {
- "billing_group_id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
- "call_forwarding_enabled": true,
- "call_recording_enabled": true,
- "caller_id_name_enabled": true,
- "cnam_listing_enabled": true,
- "connection_id": "1293384261075731499",
- "connection_name": "connection-name",
- "created_at": "2019-10-23T18:10:00.000Z",
- "customer_reference": "customer-reference",
- "emergency_address_id": "1315261609962112019",
- "emergency_enabled": true,
- "external_pin": "1234",
- "id": "1293384261075731499",
- "messaging_profile_id": "abc85f64-5717-4562-b3fc-2c9600000000",
- "messaging_profile_name": "regional-customers",
- "number_level_routing": "disabled",
- "phone_number": "+19705555098",
- "phone_number_type": "local",
- "purchased_at": "2019-10-23T18:10:00.000Z",
- "record_type": "phone_number",
- "status": "active",
- "t38_fax_gateway_enabled": true,
- "tags": [
- "tag_1",
- "tag_2"
], - "updated_at": "2019-10-24T18:10:00.000Z"
}
], - "meta": {
- "page_number": 2,
- "page_size": 25,
- "total_pages": 3,
- "total_results": 55
}
}
Successful response with a list of phone numbers with messaging settings.
Array of objects (PhoneNumberWithMessagingSettings) | |
object (PaginationMeta) |
import telnyx telnyx.api_key = "YOUR_API_KEY" telnyx.MessagingPhoneNumber.list(page={"number":1, "size":20})
{- "data": [
- {
- "country_code": "US",
- "created_at": "2019-01-23T18:10:02.574Z",
- "eligible_messaging_products": [
- "A2P"
], - "features": {
- "mms": null,
- "sms": {
- "domestic_two_way": true,
- "international_inbound": true,
- "international_outbound": true
}
}, - "health": {
- "inbound_outbound_ratio": 0.43,
- "message_count": 122,
- "spam_ratio": 0.06,
- "success_ratio": 0.94
}, - "id": "1293384261075731499",
- "messaging_product": "A2P",
- "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "phone_number": "+18005550001",
- "record_type": "messaging_settings",
- "traffic_type": "A2P",
- "type": "toll-free",
- "updated_at": "2019-01-23T18:10:02.574Z"
}
], - "meta": {
- "page_number": 2,
- "page_size": 25,
- "total_pages": 3,
- "total_results": 55
}
}
Successful response with a list of phone numbers with voice settings.
Array of objects (PhoneNumberWithVoiceSettings) | |
object (PaginationMeta) |
import telnyx telnyx.api_key = "YOUR_API_KEY" telnyx.PhoneNumbers.list_voice.list(page={"number":1,"size":20})
{- "data": [
- {
- "call_forwarding": {
- "call_forwarding_enabled": true,
- "forwarding_type": "always",
- "forwards_to": "+13035559123"
}, - "call_recording": {
- "inbound_call_recording_channels": "single",
- "inbound_call_recording_enabled": true,
- "inbound_call_recording_format": "wav"
}, - "cnam_listing": {
- "cnam_listing_details": "example",
- "cnam_listing_enabled": true
}, - "connection_id": "1d0e6cb8-8668-462e-94c6-49ae0f0ed48b",
- "customer_reference": "customer-reference",
- "emergency": {
- "emergency_address_id": "1315261609962112019",
- "emergency_enabled": true
}, - "id": "1293384261075731499",
- "media_features": {
- "accept_any_rtp_packets_enabled": true,
- "rtp_auto_adjust_enabled": true,
- "t38_fax_gateway_enabled": true
}, - "record_type": "voice_settings",
- "tech_prefix_enabled": false,
- "translated_number": "+13035559999",
- "usage_payment_method": "pay-per-minute"
}
], - "meta": {
- "page_number": 2,
- "page_size": 25,
- "total_pages": 3,
- "total_results": 55
}
}
Successful response with details about a phone number.
import telnyx telnyx.api_key = "YOUR_API_KEY" res = telnyx.PhoneNumber.retrieve('id') res.delete()
{- "data": {
- "billing_group_id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
- "call_forwarding_enabled": true,
- "call_recording_enabled": true,
- "caller_id_name_enabled": true,
- "cnam_listing_enabled": true,
- "connection_id": "1293384261075731499",
- "connection_name": "connection-name",
- "created_at": "2019-10-23T18:10:00.000Z",
- "customer_reference": "customer-reference",
- "emergency_address_id": "1315261609962112019",
- "emergency_enabled": true,
- "external_pin": "1234",
- "id": "1293384261075731499",
- "messaging_profile_id": "abc85f64-5717-4562-b3fc-2c9600000000",
- "messaging_profile_name": "regional-customers",
- "number_level_routing": "disabled",
- "phone_number": "+19705555098",
- "phone_number_type": "local",
- "purchased_at": "2019-10-23T18:10:00.000Z",
- "record_type": "phone_number",
- "status": "deleted",
- "t38_fax_gateway_enabled": true,
- "tags": [
- "tag_1",
- "tag_2"
], - "updated_at": "2019-10-24T18:10:00.000Z"
}
}
Successful response with details about a phone number.
object (PhoneNumberDetailed) | |||||||||||||||||||||||||||||||||||||||||||||||
|
import telnyx telnyx.api_key = "YOUR_API_KEY" telnyx.PhoneNumber.retrieve("id")
{- "data": {
- "billing_group_id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
- "call_forwarding_enabled": true,
- "call_recording_enabled": true,
- "caller_id_name_enabled": true,
- "cnam_listing_enabled": true,
- "connection_id": "1293384261075731499",
- "connection_name": "connection-name",
- "created_at": "2019-10-23T18:10:00.000Z",
- "customer_reference": "customer-reference",
- "emergency_address_id": "1315261609962112019",
- "emergency_enabled": true,
- "external_pin": "1234",
- "id": "1293384261075731499",
- "messaging_profile_id": "abc85f64-5717-4562-b3fc-2c9600000000",
- "messaging_profile_name": "regional-customers",
- "number_level_routing": "disabled",
- "phone_number": "+19705555098",
- "phone_number_type": "local",
- "purchased_at": "2019-10-23T18:10:00.000Z",
- "record_type": "phone_number",
- "status": "active",
- "t38_fax_gateway_enabled": true,
- "tags": [
- "tag_1",
- "tag_2"
], - "updated_at": "2019-10-24T18:10:00.000Z"
}
}
Updated settings for the phone number.
billing_group_id | string Identifies the billing group associated with the phone number. |
connection_id | string Identifies the connection associated with the phone number. |
customer_reference | string A customer reference string for customer look ups. |
external_pin | string If someone attempts to port your phone number away from Telnyx and your phone number has an external PIN set, we 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. |
number_level_routing | string Default: "enabled" Specifies whether the number can have overrides to the routing settings on itself (enabled) or if it uses the associated connection for all routing settings (disabled). Defaults to enabled but will be changed to disabled in the future. There are performance advantages to using disabled and setting all routing information at the connection level. |
tags | Array of strings A list of user-assigned tags to help organize phone numbers. |
Successful response with details about a phone number.
object (PhoneNumberDetailed) | |||||||||||||||||||||||||||||||||||||||||||||||
|
{- "address_id": "dc8f39ac-953d-4520-b93b-786ae87db0da",
- "billing_group_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
- "connection_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
- "customer_reference": "customer-reference",
- "external_pin": "1234",
- "id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
- "number_level_routing": "disabled",
- "tags": [
- "tag"
]
}
{- "data": {
- "billing_group_id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
- "call_forwarding_enabled": true,
- "call_recording_enabled": true,
- "caller_id_name_enabled": true,
- "cnam_listing_enabled": true,
- "connection_id": "1293384261075731499",
- "connection_name": "connection-name",
- "created_at": "2019-10-23T18:10:00.000Z",
- "customer_reference": "customer-reference",
- "emergency_address_id": "1315261609962112019",
- "emergency_enabled": true,
- "external_pin": "1234",
- "id": "1293384261075731499",
- "messaging_profile_id": "abc85f64-5717-4562-b3fc-2c9600000000",
- "messaging_profile_name": "regional-customers",
- "number_level_routing": "disabled",
- "phone_number": "+19705555098",
- "phone_number_type": "local",
- "purchased_at": "2019-10-23T18:10:00.000Z",
- "record_type": "phone_number",
- "status": "active",
- "t38_fax_gateway_enabled": true,
- "tags": [
- "tag_1",
- "tag_2"
], - "updated_at": "2019-10-24T18:10:00.000Z"
}
}
Phone number emergency enabled.
object (PhoneNumberWithVoiceSettings) | |||||||||||||||||||||||||||
|
Phone number emergency requested.
object (PhoneNumberWithVoiceSettings) | |||||||||||||||||||||||||||
|
{- "emergency_address_id": "53829456729313",
- "emergency_enabled": true
}
{- "data": {
- "call_forwarding": {
- "call_forwarding_enabled": true,
- "forwarding_type": "always",
- "forwards_to": "+13035559123"
}, - "call_recording": {
- "inbound_call_recording_channels": "single",
- "inbound_call_recording_enabled": true,
- "inbound_call_recording_format": "wav"
}, - "cnam_listing": {
- "cnam_listing_details": "example",
- "cnam_listing_enabled": true
}, - "connection_id": "1d0e6cb8-8668-462e-94c6-49ae0f0ed48b",
- "customer_reference": "customer-reference",
- "emergency": {
- "emergency_address_id": "1315261609962112019",
- "emergency_enabled": true
}, - "id": "1293384261075731499",
- "media_features": {
- "accept_any_rtp_packets_enabled": true,
- "rtp_auto_adjust_enabled": true,
- "t38_fax_gateway_enabled": true
}, - "record_type": "voice_settings",
- "tech_prefix_enabled": false,
- "translated_number": "+13035559999",
- "usage_payment_method": "pay-per-minute"
}
}
Successful response with details about a phone number including voice settings.
object (PhoneNumberWithMessagingSettings) | |||||||||||||||||||||||||||
|
import telnyx telnyx.api_key = "YOUR_API_KEY" telnyx.MessagingPhoneNumber.retrieve("id")
{- "data": {
- "country_code": "US",
- "created_at": "2019-01-23T18:10:02.574Z",
- "eligible_messaging_products": [
- "A2P"
], - "features": {
- "mms": null,
- "sms": {
- "domestic_two_way": true,
- "international_inbound": true,
- "international_outbound": true
}
}, - "health": {
- "inbound_outbound_ratio": 0.43,
- "message_count": 122,
- "spam_ratio": 0.06,
- "success_ratio": 0.94
}, - "id": "1293384261075731499",
- "messaging_product": "A2P",
- "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "phone_number": "+18005550001",
- "record_type": "messaging_settings",
- "traffic_type": "A2P",
- "type": "toll-free",
- "updated_at": "2019-01-23T18:10:02.574Z"
}
}
Updated messaging settings for the phone number
Successful response with details about a phone number including voice settings.
object (PhoneNumberWithMessagingSettings) | |||||||||||||||||||||||||||
|
{- "messaging_product": "P2P",
- "messaging_profile_id": "dd50eba1-a0c0-4563-9925-b25e842a7cb6"
}
{- "data": {
- "country_code": "US",
- "created_at": "2019-01-23T18:10:02.574Z",
- "eligible_messaging_products": [
- "A2P"
], - "features": {
- "mms": null,
- "sms": {
- "domestic_two_way": true,
- "international_inbound": true,
- "international_outbound": true
}
}, - "health": {
- "inbound_outbound_ratio": 0.43,
- "message_count": 122,
- "spam_ratio": 0.06,
- "success_ratio": 0.94
}, - "id": "1293384261075731499",
- "messaging_product": "A2P",
- "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
- "phone_number": "+18005550001",
- "record_type": "messaging_settings",
- "traffic_type": "A2P",
- "type": "toll-free",
- "updated_at": "2019-01-23T18:10:02.574Z"
}
}
Successful response with details about a phone number including voice settings.
object (PhoneNumberWithVoiceSettings) | |||||||||||||||||||||||||||
|
import telnyx telnyx.api_key = "YOUR_API_KEY" telnyx.PhoneNumbers.retrieve_voice.retrieve("id")
{- "data": {
- "call_forwarding": {
- "call_forwarding_enabled": true,
- "forwarding_type": "always",
- "forwards_to": "+13035559123"
}, - "call_recording": {
- "inbound_call_recording_channels": "single",
- "inbound_call_recording_enabled": true,
- "inbound_call_recording_format": "wav"
}, - "cnam_listing": {
- "cnam_listing_details": "example",
- "cnam_listing_enabled": true
}, - "connection_id": "1d0e6cb8-8668-462e-94c6-49ae0f0ed48b",
- "customer_reference": "customer-reference",
- "emergency": {
- "emergency_address_id": "1315261609962112019",
- "emergency_enabled": true
}, - "id": "1293384261075731499",
- "media_features": {
- "accept_any_rtp_packets_enabled": true,
- "rtp_auto_adjust_enabled": true,
- "t38_fax_gateway_enabled": true
}, - "record_type": "voice_settings",
- "tech_prefix_enabled": false,
- "translated_number": "+13035559999",
- "usage_payment_method": "pay-per-minute"
}
}
Updated voice settings for the phone number.
object (CallForwarding) The call forwarding settings for a phone number. | |
object (CallRecording) The call recording settings for a phone number. | |
object (CnamListing) The CNAM listing settings for a phone number. | |
object (MediaFeatures) The media features settings for a phone number. | |
tech_prefix_enabled | boolean Default: false Controls whether a tech prefix is enabled for this phone number. |
translated_number | string This field allows you to rewrite the destination number of an inbound call before the call is routed to you. The value of this field may be any alphanumeric value, and the value will replace the number originally dialed. |
usage_payment_method | string Default: "pay-per-minute" Controls whether a number is billed per minute or uses your concurrent channels. |
Successful response with details about a phone number including voice settings.
object (PhoneNumberWithVoiceSettings) | |||||||||||||||||||||||||||
|
{- "call_forwarding": {
- "call_forwarding_enabled": true,
- "forwarding_type": "always",
- "forwards_to": "+13035559123"
}, - "call_recording": {
- "inbound_call_recording_channels": "single",
- "inbound_call_recording_enabled": true,
- "inbound_call_recording_format": "wav"
}, - "cnam_listing": {
- "cnam_listing_details": "example",
- "cnam_listing_enabled": true
}, - "media_features": {
- "accept_any_rtp_packets_enabled": true,
- "rtp_auto_adjust_enabled": true,
- "t38_fax_gateway_enabled": true
}, - "tech_prefix_enabled": true,
- "translated_number": "+13035559999",
- "usage_payment_method": "pay-per-minute"
}
{- "data": {
- "call_forwarding": {
- "call_forwarding_enabled": true,
- "forwarding_type": "always",
- "forwards_to": "+13035559123"
}, - "call_recording": {
- "inbound_call_recording_channels": "single",
- "inbound_call_recording_enabled": true,
- "inbound_call_recording_format": "wav"
}, - "cnam_listing": {
- "cnam_listing_details": "example",
- "cnam_listing_enabled": true
}, - "connection_id": "1d0e6cb8-8668-462e-94c6-49ae0f0ed48b",
- "customer_reference": "customer-reference",
- "emergency": {
- "emergency_address_id": "1315261609962112019",
- "emergency_enabled": true
}, - "id": "1293384261075731499",
- "media_features": {
- "accept_any_rtp_packets_enabled": true,
- "rtp_auto_adjust_enabled": true,
- "t38_fax_gateway_enabled": true
}, - "record_type": "voice_settings",
- "tech_prefix_enabled": false,
- "translated_number": "+13035559999",
- "usage_payment_method": "pay-per-minute"
}
}