Create a phone number block
POST/porting_orders/:porting_order_id/phone_number_blocks
Creates a new phone number block.
Request
Path Parameters
Identifies the Porting Order associated with the phone number block
- application/json
Body
required
Array [
]
phone_number_range
object
required
Possible values: Value must match regular expression ^\+\d{7,15}$
Specifies the start of the phone number range for this porting phone number block.
Possible values: Value must match regular expression ^\+\d{7,15}$
Specifies the end of the phone number range for this porting phone number block.
activation_ranges
object[]
required
Specifies the activation ranges for this porting phone number block. The activation range must be within the block range and should not overlap with other activation ranges.
Possible values: Value must match regular expression ^\+\d{7,15}$
Specifies the start of the activation range. Must be greater or equal the start of the extension range.
Possible values: Value must match regular expression ^\+\d{7,15}$
Specifies the end of the activation range. It must be no more than the end of the extension range.
Specifies the activation ranges for this porting phone number block. The activation range must be within the block range and should not overlap with other activation ranges.
Responses
201: Successful response
- application/json
404: Not found
422: Unprocessable entity. Check message field in response for details.
Request samples
curl -L 'https://api.telnyx.com/v2/porting_orders/:porting_order_id/phone_number_blocks' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"phone_number_range": {
"start_at": "+4930244999901",
"end_at": "+4930244999910"
},
"activation_ranges": [
{
"start_at": "+4930244999901",
"end_at": "+4930244999910"
}
]
}'
Response samples
{
"data": {
"id": "f24151b6-3389-41d3-8747-7dd8c681e5e2",
"country_code": "DE",
"phone_number_type": "local",
"phone_number_range": {
"start_at": "+4930244999901",
"end_at": "+4930244999910"
},
"activation_ranges": [
{
"start_at": "+4930244999901",
"end_at": "+4930244999910"
}
],
"record_type": "porting_phone_number_block",
"created_at": "2021-03-19T10:07:15.527Z",
"updated_at": "2021-03-19T10:07:15.527Z"
}
}