Successful response with a list of phone numbers background jobs.
Array of objects (PhoneNumbersJob) | |
object (PaginationMeta) |
const telnyx = require('telnyx')('YOUR_API_KEY'); const {data: numberJobs} = await telnyx.numberBackgroundJobs.list();
{- "data": [
- {
- "created_at": "2020-10-23T18:10:00.000Z",
- "etc": "2020-10-30T18:10:00.000Z",
- "failed_operations": [
- {
- "errors": [
- {
- "code": "10015",
- "detail": "The field is invalid.",
- "source": "/emergency_address_id",
- "title": "Bad Request"
}
], - "id": "3388768018273",
- "phone_number": "+19705551234"
}
], - "id": "42587e44-3a3e-46de-9255-0c9a7a1d1ec7",
- "pending_operations": [
- {
- "id": "2637816387126861837",
- "phone_number": "+19705555099"
}
], - "phone_numbers": [
- {
- "id": "2637816387126861836"
}, - {
- "phone_number": "+19715555098"
}, - {
- "phone_number": "+19705555099"
}, - {
- "id": "3388768018273"
}
], - "record_type": "phone_numbers_job",
- "status": "pending",
- "successful_operations": [
- {
- "id": "2637816387126861836",
- "phone_number": "+19705555098"
}, - {
- "id": "33081887126861836",
- "phone_number": "+19715555098"
}
], - "type": "update_emergency_settings",
- "updated_at": "2020-10-23T18:10:01.000Z"
}
], - "meta": {
- "page_number": 2,
- "page_size": 25,
- "total_pages": 3,
- "total_results": 55
}
}
Creates a new background job to delete a batch of numbers. At most one thousand numbers can be updated per API call.
Phone numbers job delete phone numbers requested.
{- "phone_numbers": [
- "+19705555098",
- "+19715555098",
- "32873127836"
]
}
{- "data": {
- "created_at": "2020-10-23T18:10:00.000Z",
- "etc": "2020-10-30T18:10:00.000Z",
- "failed_operations": [
- {
- "errors": [
- {
- "code": "10015",
- "detail": "The field is invalid.",
- "source": "/emergency_address_id",
- "title": "Bad Request"
}
], - "id": "3388768018273",
- "phone_number": "+19705551234"
}
], - "id": "42587e44-3a3e-46de-9255-0c9a7a1d1ec7",
- "pending_operations": [
- {
- "id": "2637816387126861837",
- "phone_number": "+19705555099"
}
], - "phone_numbers": [
- {
- "id": "2637816387126861836"
}, - {
- "phone_number": "+19715555098"
}, - {
- "phone_number": "+19705555099"
}, - {
- "id": "3388768018273"
}
], - "record_type": "phone_numbers_job",
- "status": "pending",
- "successful_operations": [
- {
- "id": "2637816387126861836",
- "phone_number": "+19705555098"
}, - {
- "id": "33081887126861836",
- "phone_number": "+19715555098"
}
], - "type": "update_emergency_settings",
- "updated_at": "2020-10-23T18:10:01.000Z"
}
}
Creates a background job to update the emergency settings of a collection of phone numbers. At most one thousand numbers can be updated per API call.
Phone numbers enable emergency requested.
object (PhoneNumbersJob) | |||||||||||||||||||||||
|
{- "emergency_address_id": "53829456729313",
- "emergency_enabled": true,
- "phone_numbers": [
- "+19705555098",
- "+19715555098",
- "32873127836"
]
}
{- "data": {
- "created_at": "2020-10-23T18:10:00.000Z",
- "etc": "2020-10-30T18:10:00.000Z",
- "failed_operations": [
- {
- "errors": [
- {
- "code": "10015",
- "detail": "The field is invalid.",
- "source": "/emergency_address_id",
- "title": "Bad Request"
}
], - "id": "3388768018273",
- "phone_number": "+19705551234"
}
], - "id": "42587e44-3a3e-46de-9255-0c9a7a1d1ec7",
- "pending_operations": [
- {
- "id": "2637816387126861837",
- "phone_number": "+19705555099"
}
], - "phone_numbers": [
- {
- "id": "2637816387126861836"
}, - {
- "phone_number": "+19715555098"
}, - {
- "phone_number": "+19705555099"
}, - {
- "id": "3388768018273"
}
], - "record_type": "phone_numbers_job",
- "status": "pending",
- "successful_operations": [
- {
- "id": "2637816387126861836",
- "phone_number": "+19705555098"
}, - {
- "id": "33081887126861836",
- "phone_number": "+19715555098"
}
], - "type": "update_emergency_settings",
- "updated_at": "2020-10-23T18:10:01.000Z"
}
}
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.
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. |
phone_numbers required | Array of strings Array of phone number ids and/or phone numbers in E164 format to update |
tags | Array of strings A list of user-assigned tags to help organize phone numbers. |
Phone numbers job update phone numbers requested.
object (PhoneNumbersJob) | |||||||||||||||||||||||
|
{- "billing_group_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
- "connection_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
- "customer_reference": "customer-reference",
- "external_pin": "123456",
- "phone_numbers": [
- "1583466971586889004",
- "+13127367254"
], - "tags": [
- "tag"
]
}
{- "data": {
- "created_at": "2020-10-23T18:10:00.000Z",
- "etc": "2020-10-30T18:10:00.000Z",
- "failed_operations": [
- {
- "errors": [
- {
- "code": "10015",
- "detail": "The field is invalid.",
- "source": "/emergency_address_id",
- "title": "Bad Request"
}
], - "id": "3388768018273",
- "phone_number": "+19705551234"
}
], - "id": "42587e44-3a3e-46de-9255-0c9a7a1d1ec7",
- "pending_operations": [
- {
- "id": "2637816387126861837",
- "phone_number": "+19705555099"
}
], - "phone_numbers": [
- {
- "id": "2637816387126861836"
}, - {
- "phone_number": "+19715555098"
}, - {
- "phone_number": "+19705555099"
}, - {
- "id": "3388768018273"
}
], - "record_type": "phone_numbers_job",
- "status": "pending",
- "successful_operations": [
- {
- "id": "2637816387126861836",
- "phone_number": "+19705555098"
}, - {
- "id": "33081887126861836",
- "phone_number": "+19715555098"
}
], - "type": "update_emergency_settings",
- "updated_at": "2020-10-23T18:10:01.000Z"
}
}
Phone numbers job details.
object (PhoneNumbersJob) | |||||||||||||||||||||||
|
const telnyx = require('telnyx')('YOUR_API_KEY'); const {data: numberJob} = await telnyx.numberBackgroundJobs.retrieve('123');
{- "data": {
- "created_at": "2020-10-23T18:10:00.000Z",
- "etc": "2020-10-30T18:10:00.000Z",
- "failed_operations": [
- {
- "errors": [
- {
- "code": "10015",
- "detail": "The field is invalid.",
- "source": "/emergency_address_id",
- "title": "Bad Request"
}
], - "id": "3388768018273",
- "phone_number": "+19705551234"
}
], - "id": "42587e44-3a3e-46de-9255-0c9a7a1d1ec7",
- "pending_operations": [
- {
- "id": "2637816387126861837",
- "phone_number": "+19705555099"
}
], - "phone_numbers": [
- {
- "id": "2637816387126861836"
}, - {
- "phone_number": "+19715555098"
}, - {
- "phone_number": "+19705555099"
}, - {
- "id": "3388768018273"
}
], - "record_type": "phone_numbers_job",
- "status": "pending",
- "successful_operations": [
- {
- "id": "2637816387126861836",
- "phone_number": "+19705555098"
}, - {
- "id": "33081887126861836",
- "phone_number": "+19715555098"
}
], - "type": "update_emergency_settings",
- "updated_at": "2020-10-23T18:10:01.000Z"
}
}