Number Configurations

Configure your phone numbers

Retrieve a phone number with messaging settings

SecuritybearerAuth
Request
path Parameters
id
required
string

Identifies the type of resource.

Responses
200

Successful response with details about a phone number including voice settings.

Response Schema: application/json
object (PhoneNumberWithMessagingSettings)
country_code
string^[A-Z]{2}$

ISO 3166-1 alpha-2 country code.

created_at
string <date-time>

ISO 8601 formatted date indicating when the resource was created.

eligible_messaging_products
Array of strings

The messaging products that this number can be registered to use

object
object (NumberHealthMetrics)

High level health metrics about the number and it's messaging sending patterns.

id
string

Identifies the type of resource.

messaging_product
string

The messaging product that the number is registered to use

messaging_profile_id
string

Unique identifier for a messaging profile.

phone_number
string <e164>

+E.164 formatted phone number.

record_type
string

Identifies the type of the resource.

Enum: "messaging_phone_number" "messaging_settings"
traffic_type
string

The messaging traffic or use case for which the number is currently configured.

type
string

The type of the phone number

Enum: "long-code" "toll-free" "short-code" "longcode" "tollfree" "shortcode"
updated_at
string <date-time>

ISO 8601 formatted date indicating when the resource was updated.

default

Unexpected error

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

telnyx.MessagingPhoneNumber.retrieve("id")
Response samples
application/json
{
  • "data": {
    • "country_code": "US",
    • "created_at": "2019-01-23T18:10:02.574Z",
    • "eligible_messaging_products": [
      • "A2P"
      ],
    • "features": {
      • "mms": null,
      • "sms": {
        • "domestic_two_way": true,
        • "international_inbound": true,
        • "international_outbound": true
        }
      },
    • "health": {
      • "inbound_outbound_ratio": 0.43,
      • "message_count": 122,
      • "spam_ratio": 0.06,
      • "success_ratio": 0.94
      },
    • "id": "1293384261075731499",
    • "messaging_product": "A2P",
    • "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    • "phone_number": "+18005550001",
    • "record_type": "messaging_settings",
    • "traffic_type": "A2P",
    • "type": "toll-free",
    • "updated_at": "2019-01-23T18:10:02.574Z"
    }
}

Update a phone number with messaging settings

SecuritybearerAuth
Request
path Parameters
id
required
string

Identifies the type of resource.

Request Body schema: application/json
required

Updated messaging settings for the phone number

messaging_product
string

The requested messaging product the number should be on

messaging_profile_id
string

Unique identifier for a messaging profile.

Responses
200

Successful response with details about a phone number including voice settings.

Response Schema: application/json
object (PhoneNumberWithMessagingSettings)
country_code
string^[A-Z]{2}$

ISO 3166-1 alpha-2 country code.

created_at
string <date-time>

ISO 8601 formatted date indicating when the resource was created.

eligible_messaging_products
Array of strings

The messaging products that this number can be registered to use

object
object (NumberHealthMetrics)

High level health metrics about the number and it's messaging sending patterns.

id
string

Identifies the type of resource.

messaging_product
string

The messaging product that the number is registered to use

messaging_profile_id
string

Unique identifier for a messaging profile.

phone_number
string <e164>

+E.164 formatted phone number.

record_type
string

Identifies the type of the resource.

Enum: "messaging_phone_number" "messaging_settings"
traffic_type
string

The messaging traffic or use case for which the number is currently configured.

type
string

The type of the phone number

Enum: "long-code" "toll-free" "short-code" "longcode" "tollfree" "shortcode"
updated_at
string <date-time>

ISO 8601 formatted date indicating when the resource was updated.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
title
required
string
detail
string
object
meta
object
patch/phone_numbers/{id}/messaging
Request samples
application/json
{
  • "messaging_product": "P2P",
  • "messaging_profile_id": "dd50eba1-a0c0-4563-9925-b25e842a7cb6"
}
Response samples
application/json
{
  • "data": {
    • "country_code": "US",
    • "created_at": "2019-01-23T18:10:02.574Z",
    • "eligible_messaging_products": [
      • "A2P"
      ],
    • "features": {
      • "mms": null,
      • "sms": {
        • "domestic_two_way": true,
        • "international_inbound": true,
        • "international_outbound": true
        }
      },
    • "health": {
      • "inbound_outbound_ratio": 0.43,
      • "message_count": 122,
      • "spam_ratio": 0.06,
      • "success_ratio": 0.94
      },
    • "id": "1293384261075731499",
    • "messaging_product": "A2P",
    • "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    • "phone_number": "+18005550001",
    • "record_type": "messaging_settings",
    • "traffic_type": "A2P",
    • "type": "toll-free",
    • "updated_at": "2019-01-23T18:10:02.574Z"
    }
}

List phone numbers with messaging settings

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 phone numbers with messaging settings.

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

Unexpected error

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

telnyx.MessagingPhoneNumber.list(page={"number":1, "size":20})
Response samples
application/json
{
  • "data": [
    • {
      • "country_code": "US",
      • "created_at": "2019-01-23T18:10:02.574Z",
      • "eligible_messaging_products": [
        • "A2P"
        ],
      • "features": {
        • "mms": null,
        • "sms": {
          • "domestic_two_way": true,
          • "international_inbound": true,
          • "international_outbound": true
          }
        },
      • "health": {
        • "inbound_outbound_ratio": 0.43,
        • "message_count": 122,
        • "spam_ratio": 0.06,
        • "success_ratio": 0.94
        },
      • "id": "1293384261075731499",
      • "messaging_product": "A2P",
      • "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      • "phone_number": "+18005550001",
      • "record_type": "messaging_settings",
      • "traffic_type": "A2P",
      • "type": "toll-free",
      • "updated_at": "2019-01-23T18:10:02.574Z"
      }
    ],
  • "meta": {
    • "total_pages": 3,
    • "total_results": 55,
    • "page_number": 2,
    • "page_size": 25
    }
}