Update the emergency settings from a batch of numbers
POST/phone_numbers/jobs/update_emergency_settings
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.
Request
- application/json
Body
required
Indicates whether to enable emergency services on this number.
Identifies the address to be used with emergency services.
Responses
202: Phone numbers enable emergency requested.
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
Array [
]
Array [
]
Array [
Array [
]
]
data
object
Identifies the resource.
Identifies the type of the resource.
Possible values: [pending
, in_progress
, completed
, failed
, expired
]
Default value: pending
Indicates the completion status of the background update.
Possible values: [update_emergency_settings
, delete_phone_numbers
, update_phone_numbers
]
Identifies the type of the background job.
ISO 8601 formatted date indicating when the estimated time of completion of the background job.
ISO 8601 formatted date indicating when the resource was created.
ISO 8601 formatted date indicating when the resource was updated.
phone_numbers
PhoneNumbersJobPhoneNumber[]
The phone number in e164 format.
The phone number's ID
successful_operations
PhoneNumbersJobSuccessfulOperation[]
The phone number in e164 format.
The phone number's ID
pending_operations
PhoneNumbersJobPendingOperation[]
The phone number in e164 format.
The phone number's ID
failed_operations
PhoneNumbersJobFailedOperation[]
The phone number in e164 format.
The phone number's ID
errors
Error[]
source
object
JSON pointer (RFC6901) to the offending entity.
Indicates which query parameter caused the error.
meta
object
URL with additional information on the error.
{
"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"
}
]
}
]
}
}
401: Unauthorized
- application/json
- Schema
- Example (from schema)
- Authentication Failed
Schema
Array [
]
errors
Error[]
source
object
JSON pointer (RFC6901) to the offending entity.
Indicates which query parameter caused the error.
meta
object
URL with additional information on the error.
{
"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": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}
403: Forbidden
- application/json
- Schema
- Example (from schema)
- Not authorized
Schema
Array [
]
errors
Error[]
source
object
JSON pointer (RFC6901) to the offending entity.
Indicates which query parameter caused the error.
meta
object
URL with additional information on the error.
{
"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": "10006",
"title": "Not authorized",
"detail": "You are not authorized to access the requested resource.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10006"
}
}
]
}
422: Unprocessable Entity
- application/json
- Schema
- Example (from schema)
- Phone numbers must be present
- Maximum allowed phone numbers
- Minimum allowed phone numbers
- Mixed IDs and E164 values
- Phone number ownership
- Maximum jobs allowed
Schema
Array [
]
errors
Error[]
source
object
JSON pointer (RFC6901) to the offending entity.
Indicates which query parameter caused the error.
meta
object
URL with additional information on the error.
{
"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": "10015",
"title": "Bad Request",
"detail": "must be present",
"source": {
"pointer": "/phone_numbers"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "1000 numbers is the maximum allowed.",
"source": {
"pointer": "/phone_numbers"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "You must provide at least 1 phone number.",
"source": {
"pointer": "/phone_numbers"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "You must specify either all phone numbers in the e164 format or all as phone number ids",
"source": {
"pointer": "/phone_numbers"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "You must own every number in the bulk request",
"source": {
"pointer": "/phone_numbers"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "You can have at most 500 pending or in progress jobs",
"source": {
"pointer": "/base"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}
default: Unexpected error
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
Error[]
source
object
JSON pointer (RFC6901) to the offending entity.
Indicates which query parameter caused the error.
meta
object
URL with additional information on the error.
{
"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"
}
}
]
}