Messaging Profiles API

Messaging profiles API

List messaging profile metrics

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

id
string <uuid>

The id of the messaging profile(s) to retrieve

time_frame
string
Default: "24h"

The timeframe for which you'd like to retrieve metrics.

Enum: "1h" "3h" "24h" "3d" "7d" "30d"
Responses
200

Successful response with a list of messaging profile metrics.

Response Schema: application/json
Array of objects (MessagingProfileHighLevelMetrics)
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_profile_metrics
Request samples
Response samples
application/json
{
  • "data": [
    • {
      • "inbound": {
        • "received": 850
        },
      • "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      • "outbound": {
        • "delivered": 990,
        • "errors": 0.01,
        • "sent": 1000
        },
      • "phone_numbers": 250,
      • "record_type": "messaging_profile_metrics"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

List messaging profiles

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 profiles.

Response Schema: application/json
Array of objects (MessagingProfile)
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_profiles
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.MessagingProfile.list(page={"number":1,"size":20})
Response samples
application/json
{
  • "data": [
    • {
      • "created_at": "2019-01-23T18:10:02.574Z",
      • "enabled": true,
      • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      • "name": "Profile for Messages",
      • "number_pool_settings": {
        • "geomatch": false,
        • "long_code_weight": 2,
        • "skip_unhealthy": false,
        • "sticky_sender": true,
        • "toll_free_weight": 10
        },
      • "record_type": "messaging_profile",
      • "updated_at": "2019-01-23T18:10:02.574Z",
      • "url_shortener_settings": {
        • "domain": "example.ex",
        • "prefix": "cmpny",
        • "replace_blacklist_only": true,
        • "send_webhooks": false
        },
      • "v1_secret": "rP1VamejkU2v0qIUxntqLW2c",
      • "webhook_api_version": "2",
      • "webhook_failover_url": "https://backup.example.com/hooks",
      • "whitelisted_destinations": [
        • "US"
        ]
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Create a messaging profile

SecuritybearerAuth
Request
Request Body schema: application/json
required

New Messaging Profile object

enabled
boolean
Default: true

Specifies whether the messaging profile is enabled or not.

name
required
string

A user friendly name for the messaging profile.

object (NumberPoolSettings)

Number Pool allows you to send messages from a pool of numbers of different types, assigning weights to each type. The pool consists of all the long code and toll free numbers assigned to the messaging profile.

To disable this feature, set the object field to null.

object (UrlShortenerSettings)

The URL shortener feature allows automatic replacement of URLs that were generated using a public URL shortener service. Some examples include bit.do, bit.ly, goo.gl, ht.ly, is.gd, ow.ly, rebrand.ly, t.co, tiny.cc, and tinyurl.com. Such URLs are replaced with with links generated by Telnyx. The use of custom links can improve branding and message deliverability.

To disable this feature, set the object field to null.

webhook_api_version
string
Default: "2"

Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format.

Enum: "1" "2" "2010-04-01"
webhook_failover_url
string <url>
Default: ""

The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails.

webhook_url
string <url>
Default: ""

The URL where webhooks related to this messaging profile will be sent.

Responses
200

Successful response with details about a messaging profile.

Response Schema: application/json
object (MessagingProfile)
created_at
string <date-time>

ISO 8601 formatted date indicating when the resource was created.

enabled
boolean

Specifies whether the messaging profile is enabled or not.

id
string <uuid>

Identifies the type of resource.

name
string

A user friendly name for the messaging profile.

object (NumberPoolSettings)

Number Pool allows you to send messages from a pool of numbers of different types, assigning weights to each type. The pool consists of all the long code and toll free numbers assigned to the messaging profile.

To disable this feature, set the object field to null.

record_type
string

Identifies the type of the resource.

Value: "messaging_profile"
updated_at
string <date-time>

ISO 8601 formatted date indicating when the resource was updated.

object (UrlShortenerSettings)

The URL shortener feature allows automatic replacement of URLs that were generated using a public URL shortener service. Some examples include bit.do, bit.ly, goo.gl, ht.ly, is.gd, ow.ly, rebrand.ly, t.co, tiny.cc, and tinyurl.com. Such URLs are replaced with with links generated by Telnyx. The use of custom links can improve branding and message deliverability.

To disable this feature, set the object field to null.

v1_secret
string

Secret used to authenticate with v1 endpoints.

webhook_api_version
string

Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format.

Enum: "1" "2" "2010-04-01"
webhook_failover_url
string <url>

The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails.

webhook_url
string <url>

The URL where webhooks related to this messaging profile will be sent.

whitelisted_destinations
Array of strings

Destinations to which the messaging profile is allowed to send. If set to null, all destinations will be allowed. Setting a value of ["*"] has the equivalent effect. The elements in the list must be valid ISO 3166-1 alpha-2 country codes.

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
postUpdate Post
postInbound Message Post
postReplaced Link Click Post
post/messaging_profiles
Request samples
application/json
{
  • "enabled": true,
  • "name": "My name",
  • "number_pool_settings": {
    • "geomatch": false,
    • "long_code_weight": 1,
    • "skip_unhealthy": true,
    • "sticky_sender": false,
    • "toll_free_weight": 10
    },
  • "url_shortener_settings": {
    • "domain": "example.ex",
    • "prefix": "",
    • "replace_blacklist_only": true,
    • "send_webhooks": false
    },
  • "webhook_api_version": "2",
  • "webhook_failover_url": "https://backup.example.com/hooks",
}
Response samples
application/json
{
  • "data": {
    • "created_at": "2019-01-23T18:10:02.574Z",
    • "enabled": true,
    • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    • "name": "Profile for Messages",
    • "number_pool_settings": {
      • "geomatch": false,
      • "long_code_weight": 2,
      • "skip_unhealthy": false,
      • "sticky_sender": true,
      • "toll_free_weight": 10
      },
    • "record_type": "messaging_profile",
    • "updated_at": "2019-01-23T18:10:02.574Z",
    • "url_shortener_settings": {
      • "domain": "example.ex",
      • "prefix": "cmpny",
      • "replace_blacklist_only": true,
      • "send_webhooks": false
      },
    • "v1_secret": "rP1VamejkU2v0qIUxntqLW2c",
    • "webhook_api_version": "2",
    • "webhook_failover_url": "https://backup.example.com/hooks",
    • "whitelisted_destinations": [
      • "US"
      ]
    }
}
Callback payload samples
application/json
{
  • "data": {
    • "event_type": "message.sent",
    • "id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
    • "occurred_at": "date-time",
    • "payload": {
      • "completed_at": null,
      • "cost": null,
      • "direction": "outbound",
      • "encoding": "GSM-7",
      • "errors": [ ],
      • "from": {
        • "carrier": "TELNYX LLC",
        • "line_type": "VoIP",
        • "phone_number": "+18445550001"
        },
      • "id": "40385f64-5717-4562-b3fc-2c963f66afa6",
      • "media": [],
      • "messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
      • "organization_id": "b448f9cc-a842-4784-98e9-03c1a5872950",
      • "parts": 1,
      • "received_at": "2019-01-23T18:10:02.574Z",
      • "record_type": "message",
      • "sent_at": null,
      • "subject": "From Telnyx!",
      • "tags": [
        • "Greetings"
        ],
      • "text": "Hello, World!",
      • "to": [
        • {
          • "carrier": "T-MOBILE USA, INC.",
          • "line_type": "Wireless",
          • "phone_number": "+18665550001",
          • "status": "queued"
          }
        ],
      • "type": "MMS",
      • "valid_until": null,
      • "webhook_failover_url": "https://backup.example.com/hooks",
      },
    • "record_type": "event"
    },
  • "meta": {}
}

Delete a messaging profile

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

The id of the messaging profile to retrieve

Responses
200

Successful response with details about a messaging profile.

Response Schema: application/json
object (MessagingProfile)
created_at
string <date-time>

ISO 8601 formatted date indicating when the resource was created.

enabled
boolean

Specifies whether the messaging profile is enabled or not.

id
string <uuid>

Identifies the type of resource.

name
string

A user friendly name for the messaging profile.

object (NumberPoolSettings)

Number Pool allows you to send messages from a pool of numbers of different types, assigning weights to each type. The pool consists of all the long code and toll free numbers assigned to the messaging profile.

To disable this feature, set the object field to null.

record_type
string

Identifies the type of the resource.

Value: "messaging_profile"
updated_at
string <date-time>

ISO 8601 formatted date indicating when the resource was updated.

object (UrlShortenerSettings)

The URL shortener feature allows automatic replacement of URLs that were generated using a public URL shortener service. Some examples include bit.do, bit.ly, goo.gl, ht.ly, is.gd, ow.ly, rebrand.ly, t.co, tiny.cc, and tinyurl.com. Such URLs are replaced with with links generated by Telnyx. The use of custom links can improve branding and message deliverability.

To disable this feature, set the object field to null.

v1_secret
string

Secret used to authenticate with v1 endpoints.

webhook_api_version
string

Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format.

Enum: "1" "2" "2010-04-01"
webhook_failover_url
string <url>

The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails.

webhook_url
string <url>

The URL where webhooks related to this messaging profile will be sent.

whitelisted_destinations
Array of strings

Destinations to which the messaging profile is allowed to send. If set to null, all destinations will be allowed. Setting a value of ["*"] has the equivalent effect. The elements in the list must be valid ISO 3166-1 alpha-2 country codes.

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_profiles/{id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

res = telnyx.MessagingProfile.retrieve('id')
res.delete()
Response samples
application/json
{
  • "data": {
    • "created_at": "2019-01-23T18:10:02.574Z",
    • "enabled": true,
    • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    • "name": "Profile for Messages",
    • "number_pool_settings": {
      • "geomatch": false,
      • "long_code_weight": 2,
      • "skip_unhealthy": false,
      • "sticky_sender": true,
      • "toll_free_weight": 10
      },
    • "record_type": "messaging_profile",
    • "updated_at": "2019-01-23T18:10:02.574Z",
    • "url_shortener_settings": {
      • "domain": "example.ex",
      • "prefix": "cmpny",
      • "replace_blacklist_only": true,
      • "send_webhooks": false
      },
    • "v1_secret": "rP1VamejkU2v0qIUxntqLW2c",
    • "webhook_api_version": "2",
    • "webhook_failover_url": "https://backup.example.com/hooks",
    • "whitelisted_destinations": [
      • "US"
      ]
    }
}

Retrieve a messaging profile

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

The id of the messaging profile to retrieve

Responses
200

Successful response with details about a messaging profile.

Response Schema: application/json
object (MessagingProfile)
created_at
string <date-time>

ISO 8601 formatted date indicating when the resource was created.

enabled
boolean

Specifies whether the messaging profile is enabled or not.

id
string <uuid>

Identifies the type of resource.

name
string

A user friendly name for the messaging profile.

object (NumberPoolSettings)

Number Pool allows you to send messages from a pool of numbers of different types, assigning weights to each type. The pool consists of all the long code and toll free numbers assigned to the messaging profile.

To disable this feature, set the object field to null.

record_type
string

Identifies the type of the resource.

Value: "messaging_profile"
updated_at
string <date-time>

ISO 8601 formatted date indicating when the resource was updated.

object (UrlShortenerSettings)

The URL shortener feature allows automatic replacement of URLs that were generated using a public URL shortener service. Some examples include bit.do, bit.ly, goo.gl, ht.ly, is.gd, ow.ly, rebrand.ly, t.co, tiny.cc, and tinyurl.com. Such URLs are replaced with with links generated by Telnyx. The use of custom links can improve branding and message deliverability.

To disable this feature, set the object field to null.

v1_secret
string

Secret used to authenticate with v1 endpoints.

webhook_api_version
string

Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format.

Enum: "1" "2" "2010-04-01"
webhook_failover_url
string <url>

The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails.

webhook_url
string <url>

The URL where webhooks related to this messaging profile will be sent.

whitelisted_destinations
Array of strings

Destinations to which the messaging profile is allowed to send. If set to null, all destinations will be allowed. Setting a value of ["*"] has the equivalent effect. The elements in the list must be valid ISO 3166-1 alpha-2 country codes.

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_profiles/{id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.MessagingProfile.retrieve("id")
Response samples
application/json
{
  • "data": {
    • "created_at": "2019-01-23T18:10:02.574Z",
    • "enabled": true,
    • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    • "name": "Profile for Messages",
    • "number_pool_settings": {
      • "geomatch": false,
      • "long_code_weight": 2,
      • "skip_unhealthy": false,
      • "sticky_sender": true,
      • "toll_free_weight": 10
      },
    • "record_type": "messaging_profile",
    • "updated_at": "2019-01-23T18:10:02.574Z",
    • "url_shortener_settings": {
      • "domain": "example.ex",
      • "prefix": "cmpny",
      • "replace_blacklist_only": true,
      • "send_webhooks": false
      },
    • "v1_secret": "rP1VamejkU2v0qIUxntqLW2c",
    • "webhook_api_version": "2",
    • "webhook_failover_url": "https://backup.example.com/hooks",
    • "whitelisted_destinations": [
      • "US"
      ]
    }
}

Update a messaging profile

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

The id of the messaging profile to retrieve

Request Body schema: application/json
required

New Messaging Profile object

enabled
boolean

Specifies whether the messaging profile is enabled or not.

name
string

A user friendly name for the messaging profile.

object (NumberPoolSettings)

Number Pool allows you to send messages from a pool of numbers of different types, assigning weights to each type. The pool consists of all the long code and toll free numbers assigned to the messaging profile.

To disable this feature, set the object field to null.

object (UrlShortenerSettings)

The URL shortener feature allows automatic replacement of URLs that were generated using a public URL shortener service. Some examples include bit.do, bit.ly, goo.gl, ht.ly, is.gd, ow.ly, rebrand.ly, t.co, tiny.cc, and tinyurl.com. Such URLs are replaced with with links generated by Telnyx. The use of custom links can improve branding and message deliverability.

To disable this feature, set the object field to null.

v1_secret
string

Secret used to authenticate with v1 endpoints.

webhook_api_version
string

Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format.

Enum: "1" "2" "2010-04-01"
webhook_failover_url
string <url>

The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails.

webhook_url
string <url>

The URL where webhooks related to this messaging profile will be sent.

whitelisted_destinations
Array of strings

Destinations to which the messaging profile is allowed to send. If set to null, all destinations will be allowed. Setting a value of ["*"] has the equivalent effect. The elements in the list must be valid ISO 3166-1 alpha-2 country codes.

Responses
200

Successful response with details about a messaging profile.

Response Schema: application/json
object (MessagingProfile)
created_at
string <date-time>

ISO 8601 formatted date indicating when the resource was created.

enabled
boolean

Specifies whether the messaging profile is enabled or not.

id
string <uuid>

Identifies the type of resource.

name
string

A user friendly name for the messaging profile.

object (NumberPoolSettings)

Number Pool allows you to send messages from a pool of numbers of different types, assigning weights to each type. The pool consists of all the long code and toll free numbers assigned to the messaging profile.

To disable this feature, set the object field to null.

record_type
string

Identifies the type of the resource.

Value: "messaging_profile"
updated_at
string <date-time>

ISO 8601 formatted date indicating when the resource was updated.

object (UrlShortenerSettings)

The URL shortener feature allows automatic replacement of URLs that were generated using a public URL shortener service. Some examples include bit.do, bit.ly, goo.gl, ht.ly, is.gd, ow.ly, rebrand.ly, t.co, tiny.cc, and tinyurl.com. Such URLs are replaced with with links generated by Telnyx. The use of custom links can improve branding and message deliverability.

To disable this feature, set the object field to null.

v1_secret
string

Secret used to authenticate with v1 endpoints.

webhook_api_version
string

Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format.

Enum: "1" "2" "2010-04-01"
webhook_failover_url
string <url>

The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails.

webhook_url
string <url>

The URL where webhooks related to this messaging profile will be sent.

whitelisted_destinations
Array of strings

Destinations to which the messaging profile is allowed to send. If set to null, all destinations will be allowed. Setting a value of ["*"] has the equivalent effect. The elements in the list must be valid ISO 3166-1 alpha-2 country codes.

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/messaging_profiles/{id}
Request samples
application/json
{
  • "enabled": true,
  • "name": "Updated Profile for Messages",
  • "number_pool_settings": {
    • "geomatch": false,
    • "long_code_weight": 2,
    • "skip_unhealthy": false,
    • "sticky_sender": true,
    • "toll_free_weight": 10
    },
  • "url_shortener_settings": {
    • "domain": "example.ex",
    • "prefix": "cmpny",
    • "replace_blacklist_only": true,
    • "send_webhooks": false
    },
  • "v1_secret": "rP1VamejkU2v0qIUxntqLW2c",
  • "webhook_api_version": "2",
  • "webhook_failover_url": "https://backup.example.com/hooks",
  • "whitelisted_destinations": [
    • "US"
    ]
}
Response samples
application/json
{
  • "data": {
    • "created_at": "2019-01-23T18:10:02.574Z",
    • "enabled": true,
    • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    • "name": "Profile for Messages",
    • "number_pool_settings": {
      • "geomatch": false,
      • "long_code_weight": 2,
      • "skip_unhealthy": false,
      • "sticky_sender": true,
      • "toll_free_weight": 10
      },
    • "record_type": "messaging_profile",
    • "updated_at": "2019-01-23T18:10:02.574Z",
    • "url_shortener_settings": {
      • "domain": "example.ex",
      • "prefix": "cmpny",
      • "replace_blacklist_only": true,
      • "send_webhooks": false
      },
    • "v1_secret": "rP1VamejkU2v0qIUxntqLW2c",
    • "webhook_api_version": "2",
    • "webhook_failover_url": "https://backup.example.com/hooks",
    • "whitelisted_destinations": [
      • "US"
      ]
    }
}

Retrieve messaging profile metrics

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

The id of the messaging profile to retrieve

query Parameters
time_frame
string
Default: "24h"

The timeframe for which you'd like to retrieve metrics.

Enum: "1h" "3h" "24h" "3d" "7d" "30d"
Responses
200

Successful response with details about a messaging profile's metrics.

Response Schema: application/json
object (MessagingProfileDetailedMetrics)
Array of objects (MessagingProfileDetailedMetric)
object (MessagingProfileHighLevelMetrics)
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_profiles/{id}/metrics
Request samples
Response samples
application/json
{
  • "data": {
    • "detailed": [
      • {
        • "metrics": [
          • {
            • "delivered": 990,
            • "errors": 0.01,
            • "label": "longcode",
            • "received": 750,
            • "sent": 1000
            }
          ],
        • "timestamp": "2019-01-23T18:10:02.574Z"
        }
      ],
    • "overview": {
      • "inbound": {
        • "received": 850
        },
      • "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      • "outbound": {
        • "delivered": 990,
        • "errors": 0.01,
        • "sent": 1000
        },
      • "phone_numbers": 250,
      • "record_type": "messaging_profile_metrics"
      }
    }
}

List phone numbers associated with a messaging profile

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

The id of the messaging profile to retrieve

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 profile phone numbers.

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>
detail
string
meta
object
object
title
required
string
get/messaging_profiles/{id}/phone_numbers
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

mp = telnyx.MessagingProfile.retrieve("uuid")
mp.phone_numbers()
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": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

List short codes associated with a messaging profile

SecuritybearerAuth
Request
path Parameters
id
required
string <uuid>

The id of the messaging profile to retrieve

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 profile short codes.

Response Schema: application/json
Array of objects (ShortCode)
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_profiles/{id}/short_codes
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

mp = telnyx.MessagingProfile.retrieve("uuid")
mp.short_codes()
Response samples
application/json
{
  • "data": [
    • {
      • "country_code": "US",
      • "created_at": "2019-01-23T18:10:02.574Z",
      • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      • "messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      • "record_type": "short_code",
      • "short_code": "12345",
      • "updated_at": "2019-01-23T18:10:02.574Z"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}