api/python/telnyx-messaging-python/SKILL.md
Send and receive SMS/MMS messages, manage messaging-enabled phone numbers, and handle opt-outs. Use when building messaging applications, implementing 2FA, or sending notifications. This skill provides Python SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-messaging-pythonInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
pip install telnyx
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.
Send a message with a Phone Number, Alphanumeric Sender ID, Short Code or Number Pool.
POST /messages — Required: to
response = client.messages.send(
to="+18445550001",
)
print(response.data)
Note: This API endpoint can only retrieve messages that are no older than 10 days since their creation.
GET /messages/{id}
message = client.messages.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(message.data)
Cancel a scheduled message that has not yet been sent.
DELETE /messages/{id}
response = client.messages.cancel_scheduled(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.id)
POST /messages/whatsapp — Required: from, to, whatsapp_message
response = client.messages.send_whatsapp(
from_="+13125551234",
to="+13125551234",
whatsapp_message={},
)
print(response.data)
POST /messages/group_mms — Required: from, to
response = client.messages.send_group_mms(
from_="+13125551234",
to=["+18655551234", "+14155551234"],
)
print(response.data)
POST /messages/long_code — Required: from, to
response = client.messages.send_long_code(
from_="+18445550001",
to="+13125550002",
)
print(response.data)
POST /messages/number_pool — Required: to, messaging_profile_id
response = client.messages.send_number_pool(
messaging_profile_id="abc85f64-5717-4562-b3fc-2c9600000000",
to="+13125550002",
)
print(response.data)
Schedule a message with a Phone Number, Alphanumeric Sender ID, Short Code or Number Pool.
POST /messages/schedule — Required: to
response = client.messages.schedule(
to="+18445550001",
)
print(response.data)
POST /messages/short_code — Required: from, to
response = client.messages.send_short_code(
from_="+18445550001",
to="+18445550001",
)
print(response.data)
Retrieve a list of opt-out blocks.
GET /messaging_optouts
page = client.messaging_optouts.list()
page = page.data[0]
print(page.messaging_profile_id)
GET /phone_numbers/{id}/messaging
messaging = client.phone_numbers.messaging.retrieve(
"id",
)
print(messaging.data)
PATCH /phone_numbers/{id}/messaging
messaging = client.phone_numbers.messaging.update(
id="id",
)
print(messaging.data)
GET /phone_numbers/messaging
page = client.phone_numbers.messaging.list()
page = page.data[0]
print(page.id)
GET /mobile_phone_numbers/{id}/messaging
messaging = client.mobile_phone_numbers.messaging.retrieve(
"id",
)
print(messaging.data)
GET /mobile_phone_numbers/messaging
page = client.mobile_phone_numbers.messaging.list()
page = page.data[0]
print(page.id)
POST /messaging_numbers/bulk_updates — Required: messaging_profile_id, numbers
messaging_numbers_bulk_update = client.messaging_numbers_bulk_updates.create(
messaging_profile_id="00000000-0000-0000-0000-000000000000",
numbers=["+18880000000", "+18880000001", "+18880000002"],
)
print(messaging_numbers_bulk_update.data)
GET /messaging_numbers/bulk_updates/{order_id}
messaging_numbers_bulk_update = client.messaging_numbers_bulk_updates.retrieve(
"order_id",
)
print(messaging_numbers_bulk_update.data)
The following webhook events are sent to your configured webhook URL.
All webhooks include telnyx-timestamp and telnyx-signature-ed25519 headers for verification (Standard Webhooks compatible).
| Event | Description |
|-------|-------------|
| deliveryUpdate | Delivery Update |
| inboundMessage | Inbound Message |
| replacedLinkClick | Replaced Link Click |
tools
Build cross-platform VoIP calling apps with React Native using Telnyx Voice SDK. High-level reactive API with automatic lifecycle management, CallKit/ConnectionService integration, and push notifications. Use for mobile VoIP apps with minimal setup.
tools
Build browser-based VoIP calling apps using Telnyx WebRTC JavaScript SDK. Covers authentication, voice calls, events, debugging, call quality metrics, and AI Agent integration. Use for web-based real-time communication.
tools
Build VoIP calling apps on iOS using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, CallKit integration, PushKit/APNS push notifications, call quality metrics, and AI Agent integration. Use when implementing real-time voice communication on iOS.
tools
Build cross-platform VoIP calling apps with Flutter using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, push notifications (FCM + APNS), call quality metrics, and AI Agent integration. Works on Android, iOS, and Web.