Messaging Hosted Number API

Manage your messaging hosted numbers

List messaging hosted number orders

SecuritybearerAuth
Request
query Parameters
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 messaging hosted number orders.

Response Schema: application/json
Array of objects (MessagingHostedNumberOrder)
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/messaging_hosted_number_orders
Request samples
const telnyx = require('telnyx')('YOUR_API_KEY');

const { data: messagingHostedNumberOrders } = await telnyx.messagingHostedNumberOrders.list();
Response samples
application/json
{
  • "data": [
    • {
      • "id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
      • "messaging_profile_id": "dc8f39ac-953d-4520-b93b-786ae87db0da",
      • "phone_numbers": [
        • {
          • "id": "bf6307bd-884d-4c1f-b6ea-c62b8c495d3c",
          • "phone_number": "+18665550001",
          • "record_type": "messaging_hosted_number",
          • "status": "pending"
          },
        • {
          • "id": "464bd54e-a328-4b11-a131-28e6793cb6f2",
          • "phone_number": "+18665550002",
          • "record_type": "messaging_hosted_number",
          • "status": "pending"
          }
        ],
      • "record_type": "messaging_hosted_number_order",
      • "status": "pending"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Create a messaging hosted number order

SecuritybearerAuth
Request
Request Body schema: application/json

Message payload

messaging_profile_id
string

Automatically associate the number with this messaging profile ID when the order is complete.

phone_numbers
Array of strings <+E.164>

Phone numbers to be used for hosted messaging.

Responses
200

Successful response with details about a messaging hosted number order.

Response Schema: application/json
object (MessagingHostedNumberOrder)
id
string <uuid>

Resource unique identifier.

messaging_profile_id
string

Automatically associate the number with this messaging profile ID when the order is complete.

Array of objects (HostedNumber)
record_type
string

Identifies the type of the resource.

status
string
Enum: "failed" "pending" "successful"
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/messaging_hosted_number_orders
Request samples
application/json
{
  • "messaging_profile_id": "dc8f39ac-953d-4520-b93b-786ae87db0da",
  • "phone_numbers": [
    • "+18665550001",
    • "+18665550002"
    ]
}
Response samples
application/json
{
  • "data": {
    • "id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
    • "messaging_profile_id": "dc8f39ac-953d-4520-b93b-786ae87db0da",
    • "phone_numbers": [
      • {
        • "id": "bf6307bd-884d-4c1f-b6ea-c62b8c495d3c",
        • "phone_number": "+18665550001",
        • "record_type": "messaging_hosted_number",
        • "status": "pending"
        },
      • {
        • "id": "464bd54e-a328-4b11-a131-28e6793cb6f2",
        • "phone_number": "+18665550002",
        • "record_type": "messaging_hosted_number",
        • "status": "pending"
        }
      ],
    • "record_type": "messaging_hosted_number_order",
    • "status": "pending"
    }
}

Retrieve a messaging hosted number order

SecuritybearerAuth
Request
path Parameters
id
required
string

Identifies the type of resource.

Responses
200

Successful response with details about a messaging hosted number order.

Response Schema: application/json
object (MessagingHostedNumberOrder)
id
string <uuid>

Resource unique identifier.

messaging_profile_id
string

Automatically associate the number with this messaging profile ID when the order is complete.

Array of objects (HostedNumber)
record_type
string

Identifies the type of the resource.

status
string
Enum: "failed" "pending" "successful"
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/messaging_hosted_number_orders/{id}
Request samples
const telnyx = require('telnyx')('YOUR_API_KEY');

const { data: messagingHostedNumberOrder } = await telnyx.messagingHostedNumberOrder.retrieve('123');
Response samples
application/json
{
  • "data": {
    • "id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
    • "messaging_profile_id": "dc8f39ac-953d-4520-b93b-786ae87db0da",
    • "phone_numbers": [
      • {
        • "id": "bf6307bd-884d-4c1f-b6ea-c62b8c495d3c",
        • "phone_number": "+18665550001",
        • "record_type": "messaging_hosted_number",
        • "status": "pending"
        },
      • {
        • "id": "464bd54e-a328-4b11-a131-28e6793cb6f2",
        • "phone_number": "+18665550002",
        • "record_type": "messaging_hosted_number",
        • "status": "pending"
        }
      ],
    • "record_type": "messaging_hosted_number_order",
    • "status": "pending"
    }
}

Upload file required for a messaging hosted number order

SecuritybearerAuth
Request
path Parameters
id
required
string

Identifies the type of resource.

Request Body schema: multipart/form-data

Message payload

bill
string <binary>

Must be the last month's bill with proof of ownership of all of the numbers in the order in PDF format.

loa
string <binary>

Must be a signed LOA for the numbers in the order in PDF format.

Responses
200

Successful response with details about a messaging hosted number order.

Response Schema: application/json
object (MessagingHostedNumberOrder)
id
string <uuid>

Resource unique identifier.

messaging_profile_id
string

Automatically associate the number with this messaging profile ID when the order is complete.

Array of objects (HostedNumber)
record_type
string

Identifies the type of the resource.

status
string
Enum: "failed" "pending" "successful"
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/messaging_hosted_number_orders/{id}/actions/file_upload
Request samples
const telnyx = require('telnyx')('YOUR_API_KEY');

const { data: messagingHostedNumberOrders.actions.fileUpload } = await telnyx.messagingHostedNumberOrders.actions.fileUpload.create(
	{}
);
Response samples
application/json
{
  • "data": {
    • "id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
    • "messaging_profile_id": "dc8f39ac-953d-4520-b93b-786ae87db0da",
    • "phone_numbers": [
      • {
        • "id": "bf6307bd-884d-4c1f-b6ea-c62b8c495d3c",
        • "phone_number": "+18665550001",
        • "record_type": "messaging_hosted_number",
        • "status": "pending"
        },
      • {
        • "id": "464bd54e-a328-4b11-a131-28e6793cb6f2",
        • "phone_number": "+18665550002",
        • "record_type": "messaging_hosted_number",
        • "status": "pending"
        }
      ],
    • "record_type": "messaging_hosted_number_order",
    • "status": "pending"
    }
}

Delete a messaging hosted number

SecuritybearerAuth
Request
path Parameters
id
required
string

Identifies the type of resource.

Responses
200

Successful response with details about a messaging hosted number.

Response Schema: application/json
object (HostedNumber)
id
string <uuid>

Identifies the type of resource.

phone_number
string <+E.164>

The messaging hosted phone number (+E.164 format)

record_type
string
status
string
Enum: "deleted" "failed" "pending" "successful"
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
delete/messaging_hosted_numbers/{id}
Request samples
const telnyx = require('telnyx')('YOUR_API_KEY');

const { data: messagingHostedNumber } = await telnyx.messagingHostedNumbers.del('123');
Response samples
application/json
{
  • "data": [
    • {
      • "id": "bf6307bd-884d-4c1f-b6ea-c62b8c495d3c",
      • "phone_number": "+18665550001",
      • "record_type": "messaging_hosted_number",
      • "status": "successful"
      }
    ]
}