Update a batch of numbers
POST/phone_numbers/jobs/update_phone_numbers
Creates a new background job to update a batch of numbers. At most one thousand numbers can be updated per API call. At least one of the updateable fields must be submitted.
Request
Query Parameters
Filter by phone number that have bundles.
Filter by phone number tags.
Filter by connection_id.
Filter by phone number. Requires at least three digits. Non-numerical characters will result in no values being returned.
Possible values: [purchase_pending
, purchase_failed
, port_pending
, active
, deleted
, port_failed
, emergency_only
, ported_out
, port_out_pending
]
Filter by phone number status.
Filter contains connection name. Requires at least three characters.
Possible values: [pay-per-minute
, channel
]
Filter by usage_payment_method.
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'.
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'.
Filter numbers via the customer_reference set.
- application/json
Body
required
Array of phone number ids and/or phone numbers in E164 format to update
A list of user-assigned tags to help organize phone numbers.
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.
A customer reference string for customer look ups.
Identifies the connection associated with the phone number.
Identifies the billing group associated with the phone number.
Indicates whether to enable or disable HD Voice on each phone number. HD Voice is a paid feature and may not be available for all phone numbers, more details about it can be found in the Telnyx support documentation.
voice
object
Controls whether a tech prefix is enabled for this phone number.
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.
Controls whether the caller ID name is enabled for this phone number.
call_forwarding
object
The call forwarding settings for a phone number.
Default value: true
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.
The phone number to which inbound calls to this number are forwarded. Inbound calls will not be forwarded if this field is left blank. If set, must be a +E.164-formatted phone number.
Possible values: [always
, on_failure
]
Call forwarding type. 'forwards_to' must be set for this to have an effect.
The call forwarding settings for a phone number.
cnam_listing
object
The CNAM listing settings for a phone number.
Enables CNAM listings for this number. Requires cnam_listing_details to also be set.
The CNAM listing details for this number. Must be alphanumeric characters or spaces with a maximum length of 15. Requires cnam_listing_enabled to also be set to true.
The CNAM listing settings for a phone number.
Possible values: [pay-per-minute
, channel
]
Default value: pay-per-minute
Controls whether a number is billed per minute or uses your concurrent channels.
media_features
object
The media features settings for a phone number.
Default value: true
When RTP Auto-Adjust is enabled, the destination RTP address port will be automatically changed to match the source of the incoming RTP packets.
When enabled, Telnyx will accept RTP packets from any customer-side IP address and port, not just those to which Telnyx is sending RTP.
Controls whether Telnyx will accept a T.38 re-INVITE for this phone number. Note that Telnyx will not send a T.38 re-INVITE; this option only controls whether one will be accepted.
The media features settings for a phone number.
call_recording
object
The call recording settings for a phone number.
When enabled, any inbound call to this number will be recorded.
Possible values: [wav
, mp3
]
Default value: wav
The audio file format for calls being recorded.
Possible values: [single
, dual
]
Default value: single
When using 'dual' channels, final audio file will be stereo recorded with the first leg on channel A, and the rest on channel B.
The call recording settings for a phone number.
Possible values: [disabled
, reject_calls
, flag_calls
]
Default value: disabled
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.
Responses
202: Phone numbers job update phone numbers requested.
- application/json
401: Unauthorized
- application/json
403: Forbidden
- application/json
422: Unprocessable Entity
- application/json
default: Unexpected error
- application/json
Request samples
curl -L 'https://api.telnyx.com/v2/phone_numbers/jobs/update_phone_numbers' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"phone_numbers": [
"1583466971586889004",
"+13127367254"
],
"tags": [
"tag"
],
"external_pin": "123456",
"customer_reference": "customer-reference",
"connection_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
"billing_group_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
"voice": {
"call_forwarding": {
"call_forwarding_enabled": true,
"forwards_to": "+13035559123",
"forwarding_type": "always"
}
}
}'
Response samples
{
"data": {
"id": "42587e44-3a3e-46de-9255-0c9a7a1d1ec7",
"record_type": "phone_numbers_job",
"status": "pending",
"type": "update_emergency_settings",
"etc": "2020-10-30T18:10:00.000Z",
"created_at": "2020-10-23T18:10:00.000Z",
"updated_at": "2020-10-23T18:10:01.000Z",
"phone_numbers": [
{
"id": "2637816387126861836"
},
{
"phone_number": "+19715555098"
},
{
"phone_number": "+19705555099"
},
{
"id": "3388768018273"
}
],
"successful_operations": [
{
"id": "2637816387126861836",
"phone_number": "+19705555098"
},
{
"id": "33081887126861836",
"phone_number": "+19715555098"
}
],
"pending_operations": [
{
"id": "2637816387126861837",
"phone_number": "+19705555099"
}
],
"failed_operations": [
{
"id": "3388768018273",
"phone_number": "+19705551234",
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "The field is invalid.",
"source": "/emergency_address_id"
}
]
}
]
}
}
{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "string"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "string"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "string"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10007",
"title": "Unexpected error",
"detail": "An unexpected error occured.",
"source": {
"pointer": "/base",
"parameter": "string"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}