Ai telnyx-messaging-profiles-curl

install
source · Clone the upstream repo
git clone https://github.com/team-telnyx/ai
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/team-telnyx/ai "$T" && mkdir -p ~/.claude/skills && cp -r "$T/providers/cursor/plugin/skills/telnyx-messaging-profiles-curl" ~/.claude/skills/team-telnyx-ai-telnyx-messaging-profiles-curl-0c4e0a && rm -rf "$T"
manifest: providers/cursor/plugin/skills/telnyx-messaging-profiles-curl/SKILL.md
source content
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->

Telnyx Messaging Profiles - curl

Installation

# curl is pre-installed on macOS, Linux, and Windows 10+

Setup

export TELNYX_API_KEY="YOUR_API_KEY_HERE"

All examples below use

$TELNYX_API_KEY
for authentication.

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:

# Check HTTP status code in response
response=$(curl -s -w "\n%{http_code}" \
  -X POST "https://api.telnyx.com/v2/messages" \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": "+13125550001", "from": "+13125550002", "text": "Hello"}')

http_code=$(echo "$response" | tail -1)
body=$(echo "$response" | sed '$d')

case $http_code in
  2*) echo "Success: $body" ;;
  422) echo "Validation error — check required fields and formats" ;;
  429) echo "Rate limited — retry after delay"; sleep 1 ;;
  401) echo "Authentication failed — check TELNYX_API_KEY" ;;
  *)   echo "Error $http_code: $body" ;;
esac

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 endpoints return paginated results. Use
    page[number]
    and
    page[size]
    query parameters to navigate pages. Check
    meta.total_pages
    in the response.

List messaging profiles

GET /messaging_profiles

curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/messaging_profiles"

Returns:

ai_assistant_id
(string | null),
alpha_sender
(string | null),
created_at
(date-time),
daily_spend_limit
(string),
daily_spend_limit_enabled
(boolean),
enabled
(boolean),
health_webhook_url
(url),
id
(uuid),
mms_fall_back_to_sms
(boolean),
mms_transcoding
(boolean),
mobile_only
(boolean),
name
(string),
number_pool_settings
(object | null),
organization_id
(string),
record_type
(enum: messaging_profile),
redaction_enabled
(boolean),
redaction_level
(integer),
resource_group_id
(string | null),
smart_encoding
(boolean),
updated_at
(date-time),
url_shortener_settings
(object | null),
v1_secret
(string),
webhook_api_version
(enum: 1, 2, 2010-04-01),
webhook_failover_url
(url),
webhook_url
(url),
whitelisted_destinations
(array[string])

Create a messaging profile

POST /messaging_profiles
— Required:
name
,
whitelisted_destinations

Optional:

ai_assistant_id
(string | null),
alpha_sender
(string | null),
daily_spend_limit
(string),
daily_spend_limit_enabled
(boolean),
enabled
(boolean),
health_webhook_url
(url),
mms_fall_back_to_sms
(boolean),
mms_transcoding
(boolean),
mobile_only
(boolean),
number_pool_settings
(object | null),
resource_group_id
(string | null),
smart_encoding
(boolean),
url_shortener_settings
(object | null),
webhook_api_version
(enum: 1, 2, 2010-04-01),
webhook_failover_url
(url),
webhook_url
(url)

curl \
  -X POST \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "my-resource",
  "whitelisted_destinations": [
    "US"
  ]
}' \
  "https://api.telnyx.com/v2/messaging_profiles"

Returns:

ai_assistant_id
(string | null),
alpha_sender
(string | null),
created_at
(date-time),
daily_spend_limit
(string),
daily_spend_limit_enabled
(boolean),
enabled
(boolean),
health_webhook_url
(url),
id
(uuid),
mms_fall_back_to_sms
(boolean),
mms_transcoding
(boolean),
mobile_only
(boolean),
name
(string),
number_pool_settings
(object | null),
organization_id
(string),
record_type
(enum: messaging_profile),
redaction_enabled
(boolean),
redaction_level
(integer),
resource_group_id
(string | null),
smart_encoding
(boolean),
updated_at
(date-time),
url_shortener_settings
(object | null),
v1_secret
(string),
webhook_api_version
(enum: 1, 2, 2010-04-01),
webhook_failover_url
(url),
webhook_url
(url),
whitelisted_destinations
(array[string])

Retrieve a messaging profile

GET /messaging_profiles/{id}

curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/messaging_profiles/550e8400-e29b-41d4-a716-446655440000"

Returns:

ai_assistant_id
(string | null),
alpha_sender
(string | null),
created_at
(date-time),
daily_spend_limit
(string),
daily_spend_limit_enabled
(boolean),
enabled
(boolean),
health_webhook_url
(url),
id
(uuid),
mms_fall_back_to_sms
(boolean),
mms_transcoding
(boolean),
mobile_only
(boolean),
name
(string),
number_pool_settings
(object | null),
organization_id
(string),
record_type
(enum: messaging_profile),
redaction_enabled
(boolean),
redaction_level
(integer),
resource_group_id
(string | null),
smart_encoding
(boolean),
updated_at
(date-time),
url_shortener_settings
(object | null),
v1_secret
(string),
webhook_api_version
(enum: 1, 2, 2010-04-01),
webhook_failover_url
(url),
webhook_url
(url),
whitelisted_destinations
(array[string])

Update a messaging profile

PATCH /messaging_profiles/{id}

Optional:

alpha_sender
(string | null),
created_at
(date-time),
daily_spend_limit
(string),
daily_spend_limit_enabled
(boolean),
enabled
(boolean),
id
(uuid),
mms_fall_back_to_sms
(boolean),
mms_transcoding
(boolean),
mobile_only
(boolean),
name
(string),
number_pool_settings
(object | null),
record_type
(enum: messaging_profile),
smart_encoding
(boolean),
updated_at
(date-time),
url_shortener_settings
(object | null),
v1_secret
(string),
webhook_api_version
(enum: 1, 2, 2010-04-01),
webhook_failover_url
(url),
webhook_url
(url),
whitelisted_destinations
(array[string])

curl \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  "https://api.telnyx.com/v2/messaging_profiles/550e8400-e29b-41d4-a716-446655440000"

Returns:

ai_assistant_id
(string | null),
alpha_sender
(string | null),
created_at
(date-time),
daily_spend_limit
(string),
daily_spend_limit_enabled
(boolean),
enabled
(boolean),
health_webhook_url
(url),
id
(uuid),
mms_fall_back_to_sms
(boolean),
mms_transcoding
(boolean),
mobile_only
(boolean),
name
(string),
number_pool_settings
(object | null),
organization_id
(string),
record_type
(enum: messaging_profile),
redaction_enabled
(boolean),
redaction_level
(integer),
resource_group_id
(string | null),
smart_encoding
(boolean),
updated_at
(date-time),
url_shortener_settings
(object | null),
v1_secret
(string),
webhook_api_version
(enum: 1, 2, 2010-04-01),
webhook_failover_url
(url),
webhook_url
(url),
whitelisted_destinations
(array[string])

Delete a messaging profile

DELETE /messaging_profiles/{id}

curl \
  -X DELETE \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  "https://api.telnyx.com/v2/messaging_profiles/550e8400-e29b-41d4-a716-446655440000"

Returns:

ai_assistant_id
(string | null),
alpha_sender
(string | null),
created_at
(date-time),
daily_spend_limit
(string),
daily_spend_limit_enabled
(boolean),
enabled
(boolean),
health_webhook_url
(url),
id
(uuid),
mms_fall_back_to_sms
(boolean),
mms_transcoding
(boolean),
mobile_only
(boolean),
name
(string),
number_pool_settings
(object | null),
organization_id
(string),
record_type
(enum: messaging_profile),
redaction_enabled
(boolean),
redaction_level
(integer),
resource_group_id
(string | null),
smart_encoding
(boolean),
updated_at
(date-time),
url_shortener_settings
(object | null),
v1_secret
(string),
webhook_api_version
(enum: 1, 2, 2010-04-01),
webhook_failover_url
(url),
webhook_url
(url),
whitelisted_destinations
(array[string])

List phone numbers associated with a messaging profile

GET /messaging_profiles/{id}/phone_numbers

curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/messaging_profiles/550e8400-e29b-41d4-a716-446655440000/phone_numbers"

Returns:

country_code
(string),
created_at
(date-time),
eligible_messaging_products
(array[string]),
features
(object),
health
(object),
id
(string),
messaging_product
(string),
messaging_profile_id
(string | null),
organization_id
(string),
phone_number
(string),
record_type
(enum: messaging_phone_number, messaging_settings),
tags
(array[string]),
traffic_type
(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 /messaging_profiles/{id}/short_codes

curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/messaging_profiles/550e8400-e29b-41d4-a716-446655440000/short_codes"

Returns:

country_code
(string),
created_at
(date-time),
id
(uuid),
messaging_profile_id
(string | null),
record_type
(enum: short_code),
short_code
(string),
tags
(array),
updated_at
(date-time)

List short codes

GET /short_codes

curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/short_codes"

Returns:

country_code
(string),
created_at
(date-time),
id
(uuid),
messaging_profile_id
(string | null),
record_type
(enum: short_code),
short_code
(string),
tags
(array),
updated_at
(date-time)

Retrieve a short code

GET /short_codes/{id}

curl -H "Authorization: Bearer $TELNYX_API_KEY" "https://api.telnyx.com/v2/short_codes/550e8400-e29b-41d4-a716-446655440000"

Returns:

country_code
(string),
created_at
(date-time),
id
(uuid),
messaging_profile_id
(string | null),
record_type
(enum: short_code),
short_code
(string),
tags
(array),
updated_at
(date-time)

Update short code

Update the settings for a specific short code. To unbind a short code from a profile, set the

messaging_profile_id
to
null
or an empty string. To add or update tags, include the tags field as an array of strings.

PATCH /short_codes/{id}
— Required:
messaging_profile_id

Optional:

tags
(array)

curl \
  -X PATCH \
  -H "Authorization: Bearer $TELNYX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "messaging_profile_id": "550e8400-e29b-41d4-a716-446655440000"
}' \
  "https://api.telnyx.com/v2/short_codes/550e8400-e29b-41d4-a716-446655440000"

Returns:

country_code
(string),
created_at
(date-time),
id
(uuid),
messaging_profile_id
(string | null),
record_type
(enum: short_code),
short_code
(string),
tags
(array),
updated_at
(date-time)