team-telnyx/telnyx-skills

telnyx-messaging-profiles-python

>- Create and manage messaging profiles with number pools, sticky sender, and geomatch features. Configure short codes for high-volume messaging. This skill provides Python SDK examples.

First seen Mar 7, 2026

Installation

$ npx skills add team-telnyx/telnyx-skills --skill telnyx-messaging-profiles-python

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from team-telnyx/telnyx-skills · top by installs.

npx skills add team-telnyx/telnyx-skills

Browse all from team-telnyx/telnyx-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 188
License LICENSE
Default branch main
Open issues 2
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

More metadata
author
telnyx
product
messaging-profiles
language
python
generated_by
telnyx-openapi-pipeline

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 10,923 B
  • docs SUMMARY.md 223 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 9 installs

SKILL.md

<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->

Telnyx Messaging Profiles - Python

Installation

pip install telnyx

Setup

import os
from telnyx import Telnyx

client = Telnyx(
    api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
)

All examples below assume client is already initialized as shown above.

Error Handling

All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:

import telnyx

try:
    result = client.messages.send(to="+13125550001", from_="+13125550002", text="Hello")
except telnyx.APIConnectionError:
    print("Network error — check connectivity and retry")
except telnyx.RateLimitError:
    # 429: rate limited — wait and retry with exponential backoff
    import time
    time.sleep(1)  # Check Retry-After header for actual delay
except telnyx.APIStatusError as e:
    print(f"API error {e.status_code}: {e.message}")
    if e.status_code == 422:
        print("Validation error — check required fields and formats")

Common error codes: 401 invalid API key, 403 insufficient permissions, 404 resource not found, 422 validation error (check field formats), 429 rate limited (retry with exponential backoff).

Important Notes

  • Pagination: List methods return an auto-paginating iterator. Use for item in page_result: to iterate through all pages automatically.

List messaging profiles

GET /messaging_profiles

page = client.messaging_profiles.list()
page = page.data[0]
print(page.id)

Returns: aiassistantid (string | null), alphasender (string | null), createdat (date-time), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), healthwebhookurl (url), id (uuid), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), name (string), numberpoolsettings (object | null), organizationid (string), recordtype (enum: messagingprofile), redactionenabled (boolean), redactionlevel (integer), resourcegroupid (string | null), smartencoding (boolean), updatedat (date-time), urlshortenersettings (object | null), v1secret (string), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url), whitelisted_destinations (array[string])

Create a messaging profile

POST /messagingprofiles — Required: name, whitelisteddestinations

Optional: aiassistantid (string | null), alphasender (string | null), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), healthwebhookurl (url), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), numberpoolsettings (object | null), resourcegroupid (string | null), smartencoding (boolean), urlshortenersettings (object | null), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url)

messaging_profile = client.messaging_profiles.create(
    name="My name",
    whitelisted_destinations=["US"],
)
print(messaging_profile.data)

Returns: aiassistantid (string | null), alphasender (string | null), createdat (date-time), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), healthwebhookurl (url), id (uuid), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), name (string), numberpoolsettings (object | null), organizationid (string), recordtype (enum: messagingprofile), redactionenabled (boolean), redactionlevel (integer), resourcegroupid (string | null), smartencoding (boolean), updatedat (date-time), urlshortenersettings (object | null), v1secret (string), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url), whitelisted_destinations (array[string])

Retrieve a messaging profile

GET /messaging_profiles/{id}

messaging_profile = client.messaging_profiles.retrieve(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(messaging_profile.data)

Returns: aiassistantid (string | null), alphasender (string | null), createdat (date-time), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), healthwebhookurl (url), id (uuid), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), name (string), numberpoolsettings (object | null), organizationid (string), recordtype (enum: messagingprofile), redactionenabled (boolean), redactionlevel (integer), resourcegroupid (string | null), smartencoding (boolean), updatedat (date-time), urlshortenersettings (object | null), v1secret (string), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url), whitelisted_destinations (array[string])

Update a messaging profile

PATCH /messaging_profiles/{id}

Optional: aiassistantid (string | null), alphasender (string | null), createdat (date-time), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), id (uuid), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), name (string), numberpoolsettings (object | null), recordtype (enum: messagingprofile), smartencoding (boolean), updatedat (date-time), urlshortenersettings (object | null), v1secret (string), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url), whitelisteddestinations (array[string])

messaging_profile = client.messaging_profiles.update(
    messaging_profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(messaging_profile.data)

Returns: aiassistantid (string | null), alphasender (string | null), createdat (date-time), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), healthwebhookurl (url), id (uuid), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), name (string), numberpoolsettings (object | null), organizationid (string), recordtype (enum: messagingprofile), redactionenabled (boolean), redactionlevel (integer), resourcegroupid (string | null), smartencoding (boolean), updatedat (date-time), urlshortenersettings (object | null), v1secret (string), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url), whitelisted_destinations (array[string])

Delete a messaging profile

DELETE /messaging_profiles/{id}

messaging_profile = client.messaging_profiles.delete(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(messaging_profile.data)

Returns: aiassistantid (string | null), alphasender (string | null), createdat (date-time), dailyspendlimit (string), dailyspendlimitenabled (boolean), enabled (boolean), healthwebhookurl (url), id (uuid), mmsfallbacktosms (boolean), mmstranscoding (boolean), mobileonly (boolean), name (string), numberpoolsettings (object | null), organizationid (string), recordtype (enum: messagingprofile), redactionenabled (boolean), redactionlevel (integer), resourcegroupid (string | null), smartencoding (boolean), updatedat (date-time), urlshortenersettings (object | null), v1secret (string), webhookapiversion (enum: 1, 2, 2010-04-01), webhookfailoverurl (url), webhookurl (url), whitelisted_destinations (array[string])

List phone numbers associated with a messaging profile

GET /messagingprofiles/{id}/phonenumbers

page = client.messaging_profiles.list_phone_numbers(
    messaging_profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)

Returns: countrycode (string), createdat (date-time), eligiblemessagingproducts (array[string]), features (object), health (object), id (string), messagingproduct (string), messagingprofileid (string | null), organizationid (string), phonenumber (string), recordtype (enum: messagingphonenumber, messagingsettings), tags (array[string]), traffictype (string), type (enum: long-code, toll-free, short-code, longcode, tollfree, shortcode), updated_at (date-time)

List short codes associated with a messaging profile

GET /messagingprofiles/{id}/shortcodes

page = client.messaging_profiles.list_short_codes(
    messaging_profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.messaging_profile_id)

Returns: countrycode (string), createdat (date-time), id (uuid), messagingprofileid (string | null), recordtype (enum: shortcode), shortcode (string), tags (array), updatedat (date-time)

List short codes

GET /short_codes

page = client.short_codes.list()
page = page.data[0]
print(page.messaging_profile_id)

Returns: countrycode (string), createdat (date-time), id (uuid), messagingprofileid (string | null), recordtype (enum: shortcode), shortcode (string), tags (array), updatedat (date-time)

Retrieve a short code

GET /short_codes/{id}

short_code = client.short_codes.retrieve(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(short_code.data)

Returns: countrycode (string), createdat (date-time), id (uuid), messagingprofileid (string | null), recordtype (enum: shortcode), shortcode (string), tags (array), updatedat (date-time)

Update short code

Update the settings for a specific short code. To unbind a short code from a profile, set the messagingprofileid to null or an empty string. To add or update tags, include the tags field as an array of strings.

PATCH /shortcodes/{id} — Required: messagingprofile_id

Optional: tags (array)

short_code = client.short_codes.update(
    id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    messaging_profile_id="abc85f64-5717-4562-b3fc-2c9600000000",
)
print(short_code.data)

Returns: countrycode (string), createdat (date-time), id (uuid), messagingprofileid (string | null), recordtype (enum: shortcode), shortcode (string), tags (array), updatedat (date-time)