Update a batch of numbers
Changed onCreates 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. IMPORTANT: You must either specify filters (using the filter parameters) or specific phone numbers (using the phone_numbers parameter in the request body). If you specify filters, ALL phone numbers that match the given filters (up to 1000 at a time) will be updated. If you want to update only specific numbers, you must use the phone_numbers parameter in the request body. When using the phone_numbers parameter, ensure you follow the correct format as shown in the example (either phone number IDs or phone numbers in E164 format).
Request
- Base URL: https://api.telnyx.com/v2
- URL: https://api.telnyx.com/v2/phone_numbers/jobs/update_phone_numbers
- Auth: HTTP bearer
Query parameters
Consolidated filter parameter (deepObject style). Originally: filter[has_bundle], filter[tag], filter[connection_id], filter[phone_number], filter[status], filter[voice.connection_name], filter[voice.usage_payment_method], filter[billing_group_id], filter[emergency_address_id], filter[customer_reference]
{
"connection_id": "1521916448077776306",
"status": "active",
"voice.connection_name": {
"contains": "test",
"starts_with": "test",
"ends_with": "test",
"eq": "test"
},
"voice.usage_payment_method": "channel",
"billing_group_id": "62e4bf2e-c278-4282-b524-488d9c9c43b2",
"emergency_address_id": "9102160989215728032"
}Request body
Example request
{
"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",
"deletion_lock_enabled": true,
"voice": {
"call_forwarding": {
"call_forwarding_enabled": true,
"forwards_to": "+13035559123",
"forwarding_type": "always"
}
}
}Response
Update job accepted. The response contains a background job; poll GET /phone_numbers/jobs/{id} with the job id until it completes.
Example response
{
"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": {
"pointer": "/emergency_address_id"
}
}
]
}
]
}
}Changes
- breaking
the
//response's property type changed fromintegertostring, and format fromint32to no format for status - breaking
the
//response's property type changed fromintegertostring, and format fromint32to no format for status - breaking
the
//response's property type changed fromintegertostring, and format fromint32to no format for status - breaking
the
//response's property type changed fromintegertostring, and format fromint32to no format for status - breaking
the
//response's property type changed fromintegertostring, and format fromint32to no format for status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status
- breaking
- info
added the optional property
/to the response with the status
- info