api/python/telnyx-numbers-python/SKILL.md
Search for available phone numbers by location and features, check coverage, and place orders. Use when acquiring new phone numbers. This skill provides Python SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-numbers-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.
GET /country_coverage
country_coverage = client.country_coverage.retrieve()
print(country_coverage.data)
GET /country_coverage/countries/{country_code}
response = client.country_coverage.retrieve_country(
"US",
)
print(response.data)
Creates an inventory coverage request.
GET /inventory_coverage
inventory_coverages = client.inventory_coverage.list()
print(inventory_coverages.data)
Gets a paginated list of phone number reservations.
GET /number_reservations
page = client.number_reservations.list()
page = page.data[0]
print(page.id)
Creates a Phone Number Reservation for multiple numbers.
POST /number_reservations
number_reservation = client.number_reservations.create()
print(number_reservation.data)
Gets a single phone number reservation.
GET /number_reservations/{number_reservation_id}
number_reservation = client.number_reservations.retrieve(
"number_reservation_id",
)
print(number_reservation.data)
Extends reservation expiry time on all phone numbers.
POST /number_reservations/{number_reservation_id}/actions/extend
response = client.number_reservations.actions.extend(
"number_reservation_id",
)
print(response.data)
Get a paginated list of number orders.
GET /number_orders
page = client.number_orders.list()
page = page.data[0]
print(page.id)
Creates a phone number order.
POST /number_orders
number_order = client.number_orders.create()
print(number_order.data)
Get an existing phone number order.
GET /number_orders/{number_order_id}
number_order = client.number_orders.retrieve(
"number_order_id",
)
print(number_order.data)
Updates a phone number order.
PATCH /number_orders/{number_order_id}
number_order = client.number_orders.update(
number_order_id="number_order_id",
)
print(number_order.data)
Get a paginated list of number block orders.
GET /number_block_orders
page = client.number_block_orders.list()
page = page.data[0]
print(page.id)
Creates a phone number block order.
POST /number_block_orders — Required: starting_number, range
number_block_order = client.number_block_orders.create(
range=10,
starting_number="+19705555000",
)
print(number_block_order.data)
Get an existing phone number block order.
GET /number_block_orders/{number_block_order_id}
number_block_order = client.number_block_orders.retrieve(
"number_block_order_id",
)
print(number_block_order.data)
Get a list of phone numbers associated to orders.
GET /number_order_phone_numbers
number_order_phone_numbers = client.number_order_phone_numbers.list()
print(number_order_phone_numbers.data)
POST /number_order_phone_numbers/{id}/requirement_group — Required: requirement_group_id
response = client.number_order_phone_numbers.update_requirement_group(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
requirement_group_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)
Get an existing phone number in number order.
GET /number_order_phone_numbers/{number_order_phone_number_id}
number_order_phone_number = client.number_order_phone_numbers.retrieve(
"number_order_phone_number_id",
)
print(number_order_phone_number.data)
Updates requirements for a single phone number within a number order.
PATCH /number_order_phone_numbers/{number_order_phone_number_id}
response = client.number_order_phone_numbers.update_requirements(
number_order_phone_number_id="number_order_phone_number_id",
)
print(response.data)
Get a paginated list of sub number orders.
GET /sub_number_orders
sub_number_orders = client.sub_number_orders.list()
print(sub_number_orders.data)
POST /sub_number_orders/{id}/requirement_group — Required: requirement_group_id
response = client.sub_number_orders.update_requirement_group(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
requirement_group_id="a4b201f9-8646-4e54-a7d2-b2e403eeaf8c",
)
print(response.data)
Get an existing sub number order.
GET /sub_number_orders/{sub_number_order_id}
sub_number_order = client.sub_number_orders.retrieve(
sub_number_order_id="sub_number_order_id",
)
print(sub_number_order.data)
Updates a sub number order.
PATCH /sub_number_orders/{sub_number_order_id}
sub_number_order = client.sub_number_orders.update(
sub_number_order_id="sub_number_order_id",
)
print(sub_number_order.data)
Allows you to cancel a sub number order in 'pending' status.
PATCH /sub_number_orders/{sub_number_order_id}/cancel
response = client.sub_number_orders.cancel(
"sub_number_order_id",
)
print(response.data)
Create a CSV report for sub number orders.
POST /sub_number_orders/report
sub_number_orders_report = client.sub_number_orders_report.create()
print(sub_number_orders_report.data)
Get the status and details of a sub number orders report.
GET /sub_number_orders/report/{report_id}
sub_number_orders_report = client.sub_number_orders_report.retrieve(
"12ade33a-21c0-473b-b055-b3c836e1c293",
)
print(sub_number_orders_report.data)
Download the CSV file for a completed sub number orders report.
GET /sub_number_orders/report/{report_id}/download
response = client.sub_number_orders_report.download(
"12ade33a-21c0-473b-b055-b3c836e1c293",
)
print(response)
GET /advanced_orders
advanced_orders = client.advanced_orders.list()
print(advanced_orders.data)
POST /advanced_orders
advanced_order = client.advanced_orders.create()
print(advanced_order.id)
PATCH /advanced_orders/{advanced-order-id}/requirement_group
response = client.advanced_orders.update_requirement_group(
advanced_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.id)
GET /advanced_orders/{order_id}
advanced_order = client.advanced_orders.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(advanced_order.id)
Get a paginated list of inexplicit number orders.
GET /inexplicit_number_orders
page = client.inexplicit_number_orders.list()
page = page.data[0]
print(page.id)
Create an inexplicit number order to programmatically purchase phone numbers without specifying exact numbers.
POST /inexplicit_number_orders — Required: ordering_groups
inexplicit_number_order = client.inexplicit_number_orders.create(
ordering_groups=[{
"count_requested": "count_requested",
"country_iso": "US",
"phone_number_type": "phone_number_type",
}],
)
print(inexplicit_number_order.data)
Get an existing inexplicit number order by ID.
GET /inexplicit_number_orders/{id}
inexplicit_number_order = client.inexplicit_number_orders.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(inexplicit_number_order.data)
GET /comments
comments = client.comments.list()
print(comments.data)
POST /comments
comment = client.comments.create()
print(comment.data)
GET /comments/{id}
comment = client.comments.retrieve(
"id",
)
print(comment.data)
PATCH /comments/{id}/read
response = client.comments.mark_as_read(
"id",
)
print(response.data)
GET /available_phone_number_blocks
available_phone_number_blocks = client.available_phone_number_blocks.list()
print(available_phone_number_blocks.data)
GET /available_phone_numbers
available_phone_numbers = client.available_phone_numbers.list()
print(available_phone_numbers.data)
POST /numbers_features — Required: phone_numbers
numbers_feature = client.numbers_features.create(
phone_numbers=["string"],
)
print(numbers_feature.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 |
|-------|-------------|
| numberOrderStatusUpdate | Number Order Status Update |
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.