Number Orders API

Number orders API

Retrieve all comments

SecuritybearerAuth
Request
query Parameters
filter[comment_record_type]
required
string

Record type that the comment relates to i.e number_order, sub_number_order or number_order_phone_number

Example: filter[comment_record_type]=sub_number_order
filter[comment_record_id]
required
string

ID of the record the comments relate to

Example: filter[comment_record_id]=8ffb3622-7c6b-4ccc-b65f-7a3dc0099576
Responses
200

An array of Comment Responses

Response Schema: application/json
Array of objects (Comment)
object (PaginationMeta)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/comments
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.Comment.list(filter={"comment_record_type":"sub_number_order","comment_record_id":"8ffb3622-7c6b-4ccc-b65f-7a3dc0099576"})
Response samples
application/json
{
  • "data": [
    • {
      • "body": "Hi there, ....",
      • "comment_record_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576",
      • "comment_record_type": "sub_number_order",
      • "commenter": "user@company.com",
      • "commenter_type": "user",
      • "created_at": "2018-01-01T00:00:00.000000Z",
      • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
      • "read_at": null,
      • "updated_at": "2018-01-01T00:00:00.000000Z"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Create a comment

SecuritybearerAuth
Request
Request Body schema: application/json
required
body
string
comment_record_id
string <uuid>
comment_record_type
string
Enum: "number_order" "sub_number_order" "number_order_phone_number"
Responses
200

A Comment Response

Response Schema: application/json
object
body
string
comment_record_id
string <uuid>
comment_record_type
string
Enum: "number_order" "sub_number_order" "number_order_phone_number"
commenter
string
commenter_type
string
Enum: "admin" "user"
created_at
string <datetime>

An ISO 8901 datetime string denoting when the comment was created.

id
string <uuid>
read_at
string <datetime>

An ISO 8901 datetime string for when the comment was read.

updated_at
string <datetime>

An ISO 8901 datetime string for when the comment was updated.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
post/comments
Request samples
application/json
{
  • "body": "Hi there, ....",
  • "comment_record_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576",
  • "comment_record_type": "sub_number_order"
}
Response samples
application/json
{
  • "data": {
    • "body": "Hi there, ....",
    • "comment_record_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576",
    • "comment_record_type": "sub_number_order",
    • "commenter": "user@company.com",
    • "commenter_type": "user",
    • "created_at": "2018-01-01T00:00:00.000000Z",
    • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
    • "read_at": null,
    • "updated_at": "2018-01-01T00:00:00.000000Z"
    }
}

Retrieve a comment

SecuritybearerAuth
Request
path Parameters
id
required
string

The comment ID.

Responses
200

A Comment Response

Response Schema: application/json
object
body
string
comment_record_id
string <uuid>
comment_record_type
string
Enum: "number_order" "sub_number_order" "number_order_phone_number"
commenter
string
commenter_type
string
Enum: "admin" "user"
created_at
string <datetime>

An ISO 8901 datetime string denoting when the comment was created.

id
string <uuid>
read_at
string <datetime>

An ISO 8901 datetime string for when the comment was read.

updated_at
string <datetime>

An ISO 8901 datetime string for when the comment was updated.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/comments/{id}
Request samples
Response samples
application/json
{
  • "data": {
    • "body": "Hi there, ....",
    • "comment_record_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576",
    • "comment_record_type": "sub_number_order",
    • "commenter": "user@company.com",
    • "commenter_type": "user",
    • "created_at": "2018-01-01T00:00:00.000000Z",
    • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
    • "read_at": null,
    • "updated_at": "2018-01-01T00:00:00.000000Z"
    }
}

Mark a comment as read

SecuritybearerAuth
Request
path Parameters
id
required
string

The comment ID.

Responses
200

A Comment Response

Response Schema: application/json
object (ReadComment)
body
string
comment_record_id
string <uuid>
comment_record_type
string
Enum: "number_order" "sub_number_order" "number_order_phone_number"
commenter
string
commenter_type
string
Enum: "admin" "user"
created_at
string <datetime>

An ISO 8901 datetime string denoting when the comment was created.

id
string <uuid>
read_at
string <datetime>

An ISO 8901 datetime string for when the comment was read.

updated_at
string <datetime>

An ISO 8901 datetime string for when the comment was updated.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
patch/comments/{id}/read
Request samples
Response samples
application/json
{
  • "data": {
    • "body": "Hi there, ....",
    • "comment_record_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576",
    • "comment_record_type": "sub_number_order",
    • "commenter": "user@company.com",
    • "commenter_type": "user",
    • "created_at": "2018-01-01T00:00:00.000000Z",
    • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
    • "read_at": "2018-01-01T00:00:00.000000Z",
    • "updated_at": "2018-01-01T00:00:00.000000Z"
    }
}

Retrieve a list of phone numbers associated to orders

Get a list of phone numbers associated to orders.

SecuritybearerAuth
Responses
200

Successful response with a list of number order phone numbers.

Response Schema: application/json
Array of objects (NumberOrderPhoneNumber)
object (PaginationMeta)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/number_order_phone_numbers
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.NumberOrderPhoneNumber.list()
Response samples
application/json
{
  • "data": [
    • {
      • "country_code": "US",
      • "id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
      • "order_request_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd495",
      • "phone_number": "+19705555098",
      • "phone_number_type": "local",
      • "record_type": "number_order_phone_number",
      • "regulatory_requirements": [
        • {
          • "field_type": "address",
          • "record_type": "phone_number_regulatory_requirement",
          • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576",
          • "field_value": "45f45a04-b4be-4592-95b1-9306b9db2b21"
          }
        ],
      • "requirements_met": true,
      • "status": "pending",
      • "sub_number_order_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd496"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Retrieve a number order phone number.

Get an existing number order phone number.

SecuritybearerAuth
Request
path Parameters
number_order_phone_number_id
required
string

The number order phone number ID.

Responses
200

Successful response with details about a number order phone number.

Response Schema: application/json
object (NumberOrderPhoneNumber)
country_code
string
id
string <uuid>
order_request_id
string <uuid>
phone_number
string <e164_phone_number>
phone_number_type
string
Enum: "local" "toll_free" "mobile" "national" "shared_cost" "landline"
record_type
string
Array of objects (PhoneNumberRegulatoryRequirement)
requirements_met
boolean

True if all requirements are met for a phone number, false otherwise.

status
string

The status of the phone number in the order.

Enum: "pending" "success" "failure"
sub_number_order_id
string <uuid>
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/number_order_phone_numbers/{number_order_phone_number_id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.NumberOrderPhoneNumber.retrieve("number_order_phone_number_id")
Response samples
application/json
{
  • "data": {
    • "country_code": "US",
    • "id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
    • "order_request_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd495",
    • "phone_number": "+19705555098",
    • "phone_number_type": "local",
    • "record_type": "number_order_phone_number",
    • "regulatory_requirements": [
      • {
        • "field_type": "address",
        • "record_type": "phone_number_regulatory_requirement",
        • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576",
        • "field_value": "45f45a04-b4be-4592-95b1-9306b9db2b21"
        }
      ],
    • "requirements_met": true,
    • "status": "pending",
    • "sub_number_order_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd496"
    }
}

Update a number order phone number.

Updates a number order phone number.

SecuritybearerAuth
Request
path Parameters
number_order_phone_number_id
required
string

The number order phone number ID.

Request Body schema: application/json
required
Array of objects (UpdateRegulatoryRequirement)
Array
field_value
string

The value of the requirement, this could be an id to a resource or a string value.

requirement_id
string <uuid>

Unique id for a requirement.

Responses
200

Successful response with details about a number order phone number.

Response Schema: application/json
object (NumberOrderPhoneNumber)
country_code
string
id
string <uuid>
order_request_id
string <uuid>
phone_number
string <e164_phone_number>
phone_number_type
string
Enum: "local" "toll_free" "mobile" "national" "shared_cost" "landline"
record_type
string
Array of objects (PhoneNumberRegulatoryRequirement)
requirements_met
boolean

True if all requirements are met for a phone number, false otherwise.

status
string

The status of the phone number in the order.

Enum: "pending" "success" "failure"
sub_number_order_id
string <uuid>
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
patch/number_order_phone_numbers/{number_order_phone_number_id}
Request samples
application/json
{
  • "regulatory_requirements": [
    • {
      • "field_value": "45f45a04-b4be-4592-95b1-9306b9db2b21",
      • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576"
      }
    ]
}
Response samples
application/json
{
  • "data": {
    • "country_code": "US",
    • "id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
    • "order_request_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd495",
    • "phone_number": "+19705555098",
    • "phone_number_type": "local",
    • "record_type": "number_order_phone_number",
    • "regulatory_requirements": [
      • {
        • "field_type": "address",
        • "record_type": "phone_number_regulatory_requirement",
        • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576",
        • "field_value": "45f45a04-b4be-4592-95b1-9306b9db2b21"
        }
      ],
    • "requirements_met": true,
    • "status": "pending",
    • "sub_number_order_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd496"
    }
}

List number orders

Get a paginated list of number orders.

SecuritybearerAuth
Request
query Parameters
filter[status]
string

Filter number orders by status.

filter[created_at][gt]
string

Filter number orders later than this value.

filter[created_at][lt]
string

Filter number orders earlier than this value.

filter[phone_numbers_count]
string

Filter number order with this amount of numbers

filter[customer_reference]
string

Filter number orders via the customer reference set.

filter[requirements_met]
boolean

Filter number orders by requirements met.

page[number]
integer >= 1
Default: 1

The page number to load

page[size]
integer [ 1 .. 250 ]
Default: 20

The size of the page

Responses
200

Successful response with a list of number orders.

Response Schema: application/json
Array of objects (NumberOrder)
object (PaginationMeta)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/number_orders
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.NumberOrder.list(filter={"phone_numbers.phone_number": ["+18665552368"]})
Response samples
application/json
{
  • "data": [
    • {
      • "billing_group_id": "abc85f64-5717-4562-b3fc-2c9600",
      • "connection_id": "346789098765567",
      • "created_at": "2018-01-01T00:00:00.000000Z",
      • "customer_reference": "MY REF 001",
      • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
      • "messaging_profile_id": "abc85f64-5717-4562-b3fc-2c9600",
      • "phone_numbers_count": 1,
      • "record_type": "number_order",
      • "requirements_met": true,
      • "status": "pending",
      • "sub_number_order_ids": [
        • "string"
        ],
      • "updated_at": "2018-01-01T00:00:00.000000Z"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Create a number order

Creates a phone number order.

SecuritybearerAuth
Request
Request Body schema: application/json
required
billing_group_id
string

Identifies the billing group associated with the phone number.

connection_id
string

Identifies the connection associated with this phone number.

customer_reference
string

A customer reference string for customer look ups.

messaging_profile_id
string

Identifies the messaging profile associated with the phone number.

Array of objects (PhoneNumber)
Responses
200

Successful response with details about a number order.

Response Schema: application/json
object (NumberOrderWithPhoneNumbers)
billing_group_id
string

Identifies the messaging profile associated with the phone number.

connection_id
string

Identifies the connection associated with this phone number.

created_at
string <datetime>

An ISO 8901 datetime string denoting when the number order was created.

customer_reference
string

A customer reference string for customer look ups.

id
string <uuid>
messaging_profile_id
string

Identifies the messaging profile associated with the phone number.

phone_numbers_count
integer

The count of phone numbers in the number order.

record_type
string
requirements_met
boolean

True if all requirements are met for every phone number, false otherwise.

status
string

The status of the order.

Enum: "pending" "success" "failure"
sub_number_order_ids
Array of strings
updated_at
string <datetime>

An ISO 8901 datetime string for when the number order was updated.

Array of objects (PhoneNumber)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
Callbacks
postOrder Status Update Post
post/number_orders
Request samples
application/json
{
  • "billing_group_id": "abc85f64-5717-4562-b3fc-2c9600",
  • "connection_id": "346789098765567",
  • "created_at": "2018-01-01T00:00:00.000000Z",
  • "customer_reference": "MY REF 001",
  • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
  • "messaging_profile_id": "abc85f64-5717-4562-b3fc-2c9600",
  • "phone_numbers": [
    • {
      • "id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
      • "phone_number": "+19705555098",
      • "record_type": "number_order_phone_number",
      • "regulatory_group_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
      • "regulatory_requirements": [
        • {
          • "field_type": "address",
          • "field_value": "45f45a04-b4be-4592-95b1-9306b9db2b21",
          • "record_type": "phone_number_regulatory_requirement",
          • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576"
          }
        ],
      • "requirements_met": true,
      • "status": "success"
      }
    ],
  • "phone_numbers_count": 1,
  • "record_type": "number_order",
  • "requirements_met": true,
  • "status": "pending",
  • "updated_at": "2018-01-01T00:00:00.000000Z"
}
Response samples
application/json
{
  • "data": {
    • "billing_group_id": "abc85f64-5717-4562-b3fc-2c9600",
    • "connection_id": "346789098765567",
    • "created_at": "2018-01-01T00:00:00.000000Z",
    • "customer_reference": "MY REF 001",
    • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
    • "messaging_profile_id": "abc85f64-5717-4562-b3fc-2c9600",
    • "phone_numbers_count": 1,
    • "record_type": "number_order",
    • "requirements_met": true,
    • "status": "pending",
    • "sub_number_order_ids": [
      • "string"
      ],
    • "updated_at": "2018-01-01T00:00:00.000000Z",
    • "phone_numbers": [
      • {
        • "id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
        • "phone_number": "+19705555098",
        • "record_type": "number_order_phone_number",
        • "regulatory_group_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
        • "regulatory_requirements": [
          • {
            • "field_type": "address",
            • "field_value": "45f45a04-b4be-4592-95b1-9306b9db2b21",
            • "record_type": "phone_number_regulatory_requirement",
            • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576"
            }
          ],
        • "requirements_met": true,
        • "status": "success"
        }
      ]
    }
}
Callback payload samples
POST: Order Status Update Post
application/json
{
  • "data": {
    • "event_type": "number_order.complete",
    • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    • "occurred_at": "2019-08-24T14:15:22Z",
    • "payload": {
      • "billing_group_id": "abc85f64-5717-4562-b3fc-2c9600",
      • "connection_id": "346789098765567",
      • "created_at": "2018-01-01T00:00:00.000000Z",
      • "customer_reference": "MY REF 001",
      • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
      • "messaging_profile_id": "abc85f64-5717-4562-b3fc-2c9600",
      • "phone_numbers_count": 1,
      • "record_type": "number_order",
      • "requirements_met": true,
      • "status": "pending",
      • "sub_number_order_ids": [
        • "string"
        ],
      • "updated_at": "2018-01-01T00:00:00.000000Z"
      },
    • "record_type": "event"
    }
}

Retrieve a number order

Get an existing phone number order.

SecuritybearerAuth
Request
path Parameters
number_order_id
required
string

The number order ID.

Responses
200

Successful response with details about a number order.

Response Schema: application/json
object (NumberOrderWithPhoneNumbers)
billing_group_id
string

Identifies the messaging profile associated with the phone number.

connection_id
string

Identifies the connection associated with this phone number.

created_at
string <datetime>

An ISO 8901 datetime string denoting when the number order was created.

customer_reference
string

A customer reference string for customer look ups.

id
string <uuid>
messaging_profile_id
string

Identifies the messaging profile associated with the phone number.

phone_numbers_count
integer

The count of phone numbers in the number order.

record_type
string
requirements_met
boolean

True if all requirements are met for every phone number, false otherwise.

status
string

The status of the order.

Enum: "pending" "success" "failure"
sub_number_order_ids
Array of strings
updated_at
string <datetime>

An ISO 8901 datetime string for when the number order was updated.

Array of objects (PhoneNumber)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/number_orders/{number_order_id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.NumberOrder.retrieve("number_order_id")
Response samples
application/json
{
  • "data": {
    • "billing_group_id": "abc85f64-5717-4562-b3fc-2c9600",
    • "connection_id": "346789098765567",
    • "created_at": "2018-01-01T00:00:00.000000Z",
    • "customer_reference": "MY REF 001",
    • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
    • "messaging_profile_id": "abc85f64-5717-4562-b3fc-2c9600",
    • "phone_numbers_count": 1,
    • "record_type": "number_order",
    • "requirements_met": true,
    • "status": "pending",
    • "sub_number_order_ids": [
      • "string"
      ],
    • "updated_at": "2018-01-01T00:00:00.000000Z",
    • "phone_numbers": [
      • {
        • "id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
        • "phone_number": "+19705555098",
        • "record_type": "number_order_phone_number",
        • "regulatory_group_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
        • "regulatory_requirements": [
          • {
            • "field_type": "address",
            • "field_value": "45f45a04-b4be-4592-95b1-9306b9db2b21",
            • "record_type": "phone_number_regulatory_requirement",
            • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576"
            }
          ],
        • "requirements_met": true,
        • "status": "success"
        }
      ]
    }
}

Update a number order

Updates a phone number order.

SecuritybearerAuth
Request
path Parameters
number_order_id
required
string

The number order ID.

Request Body schema: application/json
required
customer_reference
string

A customer reference string for customer look ups.

Array of objects (PhoneNumber)
Responses
200

Successful response with details about a number order.

Response Schema: application/json
object (NumberOrderWithPhoneNumbers)
billing_group_id
string

Identifies the messaging profile associated with the phone number.

connection_id
string

Identifies the connection associated with this phone number.

created_at
string <datetime>

An ISO 8901 datetime string denoting when the number order was created.

customer_reference
string

A customer reference string for customer look ups.

id
string <uuid>
messaging_profile_id
string

Identifies the messaging profile associated with the phone number.

phone_numbers_count
integer

The count of phone numbers in the number order.

record_type
string
requirements_met
boolean

True if all requirements are met for every phone number, false otherwise.

status
string

The status of the order.

Enum: "pending" "success" "failure"
sub_number_order_ids
Array of strings
updated_at
string <datetime>

An ISO 8901 datetime string for when the number order was updated.

Array of objects (PhoneNumber)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
patch/number_orders/{number_order_id}
Request samples
application/json
{
  • "created_at": "2018-01-01T00:00:00.000000Z",
  • "customer_reference": "MY REF 001",
  • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
  • "phone_numbers": [
    • {
      • "id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
      • "phone_number": "+19705555098",
      • "record_type": "number_order_phone_number",
      • "regulatory_group_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
      • "regulatory_requirements": [
        • {
          • "field_type": "address",
          • "field_value": "45f45a04-b4be-4592-95b1-9306b9db2b21",
          • "record_type": "phone_number_regulatory_requirement",
          • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576"
          }
        ],
      • "requirements_met": true,
      • "status": "success"
      }
    ],
  • "phone_numbers_count": 1,
  • "record_type": "number_order",
  • "requirements_met": true,
  • "status": "pending",
  • "updated_at": "2018-01-01T00:00:00.000000Z"
}
Response samples
application/json
{
  • "data": {
    • "billing_group_id": "abc85f64-5717-4562-b3fc-2c9600",
    • "connection_id": "346789098765567",
    • "created_at": "2018-01-01T00:00:00.000000Z",
    • "customer_reference": "MY REF 001",
    • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
    • "messaging_profile_id": "abc85f64-5717-4562-b3fc-2c9600",
    • "phone_numbers_count": 1,
    • "record_type": "number_order",
    • "requirements_met": true,
    • "status": "pending",
    • "sub_number_order_ids": [
      • "string"
      ],
    • "updated_at": "2018-01-01T00:00:00.000000Z",
    • "phone_numbers": [
      • {
        • "id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
        • "phone_number": "+19705555098",
        • "record_type": "number_order_phone_number",
        • "regulatory_group_id": "dc8e4d67-33a0-4cbb-af74-7b58f05bd494",
        • "regulatory_requirements": [
          • {
            • "field_type": "address",
            • "field_value": "45f45a04-b4be-4592-95b1-9306b9db2b21",
            • "record_type": "phone_number_regulatory_requirement",
            • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576"
            }
          ],
        • "requirements_met": true,
        • "status": "success"
        }
      ]
    }
}

Retrieve regulartory requirements

SecuritybearerAuth
Request
query Parameters
filter[phone_number]
required
string

Record type phone number/ phone numbers

Example: filter[phone_number]=+41215470622,+41215470633
Responses
200

An array of Regulatory Requiremenst Responses

Response Schema: application/json
Array of objects (RegulatoryRequirements)
object (PaginationMeta)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/phone_numbers_regulatory_requirements
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.PhoneNumbersRegulatoryRequirement.list(filter={"phone_number":"+41215470622,+41215470633"})
Response samples
application/json
{
  • "data": [
    • {
      • "phone_number": "+41215471644",
      • "phone_number_type": "local",
      • "record_type": "phone_number_regulatory_requirements",
      • "region_information": [
        • {
          • "region_name": "CH",
          • "region_type": "country_code"
          }
        ],
      • "regulatory_requirements": [
        • {
          • "acceptance_criteria": {
            • "field_type": "address",
            • "field_value": "45f45a04-b4be-4592-95b1-9306b9db2b21",
            • "locality_limit": "Identical locality as the numbers desired"
            },
          • "description": "Address matching the DID area code (street, building number, postal code, city and country)",
          • "example": "311 W Superior St, Chicago, IL 60654",
          • "field_type": "address_id",
          • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
          • "label": "Address matching the DID area code",
          • "record_type": "regulatory_requirement"
          }
        ]
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

List sub number orders

Get a paginated list of sub number orders.

SecuritybearerAuth
Request
query Parameters
filter[user_id]
string <uuid>

User ID of the user who owns the sub number order

Example: filter[user_id]=d70873cd-7c98-401a-81b6-b1ae08246995
filter[order_request_id]
string <uuid>

ID of the number order the sub number order belongs to

Example: filter[order_request_id]=12ade33a-21c0-473b-b055-b3c836e1c293
filter[country_code]
string

ISO alpha-2 country code.

Example: filter[country_code]=US
filter[phone_number_type]
string

Phone Number Type

Example: filter[phone_number_type]=local
filter[phone_numbers_count]
integer

Amount of numbers in the sub number order

Example: filter[phone_numbers_count]=1
Responses
200

Successful response with a list of sub number orders.

Response Schema: application/json
Array of objects (SubNumberOrder)
object (PaginationMeta)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/sub_number_orders
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.SubNumberOrder.list(filter={"user_id":"d70873cd-7c98-401a-81b6-b1ae08246995","order_request_id":"12ade33a-21c0-473b-b055-b3c836e1c293"})
Response samples
application/json
{
  • "data": [
    • {
      • "country_code": "US",
      • "created_at": "2018-01-01T00:00:00.000000Z",
      • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
      • "order_request_id": "12ade33a-21c0-473b-b055-b3c836e1c293",
      • "phone_number_type": "local",
      • "phone_numbers_count": 1,
      • "record_type": "sub_number_order",
      • "regulatory_requirements": [
        • {
          • "field_type": "address",
          • "record_type": "phone_number_regulatory_requirement",
          • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576"
          }
        ],
      • "requirements_met": true,
      • "updated_at": "2018-01-01T00:00:00.000000Z",
      • "user_id": "d70873cd-7c98-401a-81b6-b1ae08246995"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Retrieve a sub number order

Get an existing sub number order.

SecuritybearerAuth
Request
path Parameters
sub_number_order_id
required
string

The sub number order ID.

query Parameters
filter[include_phone_numbers]
boolean
Default: false

Include the first 50 phone number objects in the results

Responses
200

Successful response with details about a sub number order.

Response Schema: application/json
object (SubNumberOrder)
country_code
string
created_at
string <datetime>

An ISO 8901 datetime string denoting when the number order was created.

id
string <uuid>
order_request_id
string <uuid>
phone_number_type
string
Enum: "local" "toll_free" "mobile" "national" "shared_cost" "landline"
phone_numbers_count
integer

The count of phone numbers in the number order.

record_type
string
Array of objects (SubNumberOrderRegulatoryRequirement)
requirements_met
boolean

True if all requirements are met for every phone number, false otherwise.

updated_at
string <datetime>

An ISO 8901 datetime string for when the number order was updated.

user_id
string <uuid>
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/sub_number_orders/{sub_number_order_id}
Request samples
Response samples
application/json
{
  • "data": {
    • "country_code": "US",
    • "created_at": "2018-01-01T00:00:00.000000Z",
    • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
    • "order_request_id": "12ade33a-21c0-473b-b055-b3c836e1c293",
    • "phone_number_type": "local",
    • "phone_numbers_count": 1,
    • "record_type": "sub_number_order",
    • "regulatory_requirements": [
      • {
        • "field_type": "address",
        • "record_type": "phone_number_regulatory_requirement",
        • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576"
        }
      ],
    • "requirements_met": true,
    • "updated_at": "2018-01-01T00:00:00.000000Z",
    • "user_id": "d70873cd-7c98-401a-81b6-b1ae08246995"
    }
}

Update a sub number order

Updates a sub number order.

SecuritybearerAuth
Request
path Parameters
sub_number_order_id
required
string

The sub number order ID.

Request Body schema: application/json
required
Array of objects (UpdateRegulatoryRequirement)
Array
field_value
string

The value of the requirement, this could be an id to a resource or a string value.

requirement_id
string <uuid>

Unique id for a requirement.

Responses
200

Successful response with details about a sub number order.

Response Schema: application/json
object (SubNumberOrder)
country_code
string
created_at
string <datetime>

An ISO 8901 datetime string denoting when the number order was created.

id
string <uuid>
order_request_id
string <uuid>
phone_number_type
string
Enum: "local" "toll_free" "mobile" "national" "shared_cost" "landline"
phone_numbers_count
integer

The count of phone numbers in the number order.

record_type
string
Array of objects (SubNumberOrderRegulatoryRequirement)
requirements_met
boolean

True if all requirements are met for every phone number, false otherwise.

updated_at
string <datetime>

An ISO 8901 datetime string for when the number order was updated.

user_id
string <uuid>
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
patch/sub_number_orders/{sub_number_order_id}
Request samples
application/json
{
  • "regulatory_requirements": [
    • {
      • "field_value": "45f45a04-b4be-4592-95b1-9306b9db2b21",
      • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576"
      }
    ]
}
Response samples
application/json
{
  • "data": {
    • "country_code": "US",
    • "created_at": "2018-01-01T00:00:00.000000Z",
    • "id": "12ade33a-21c0-473b-b055-b3c836e1c292",
    • "order_request_id": "12ade33a-21c0-473b-b055-b3c836e1c293",
    • "phone_number_type": "local",
    • "phone_numbers_count": 1,
    • "record_type": "sub_number_order",
    • "regulatory_requirements": [
      • {
        • "field_type": "address",
        • "record_type": "phone_number_regulatory_requirement",
        • "requirement_id": "8ffb3622-7c6b-4ccc-b65f-7a3dc0099576"
        }
      ],
    • "requirements_met": true,
    • "updated_at": "2018-01-01T00:00:00.000000Z",
    • "user_id": "d70873cd-7c98-401a-81b6-b1ae08246995"
    }
}