Telnyx

App · 20 actions

Send and track messages and manage Telnyx messaging profiles.

Actions

ActionWhat it does
Cancel scheduled messageCancel scheduled message.
Create messaging profileCreate messaging profile.
Delete messaging profileDeletes the specified messaging profile and returns the profile's final configuration.
Get balanceRetrieve the current balance, available credit, and credit limit for your account.
Get group MMSRetrieve all messages in a group MMS conversation by the group message ID.
Get messageGet message.
Get messaging profileReturns the complete configuration of the specified messaging profile, including webhook and sender-selection settings.
Get phone numberGet phone number.
Get webhook deliveryProvides webhook_delivery debug data, such as timestamps, delivery status and attempts.
List alphanumeric sender IDsList all alphanumeric sender IDs associated with a specific messaging profile.
List available phone numbersList available phone numbers.
List messaging profilesLists messaging profiles owned by the authenticated account.
List phone numbersList phone numbers.
List profile phone numbersReturns the phone numbers currently associated with the specified messaging profile.
List profile short codesReturns the short codes currently associated with the specified messaging profile.
List webhook deliveriesLists webhook_deliveries for the authenticated user
Schedule messageSchedule message.
Send group MMSQueues an MMS addressed to multiple recipients as a group conversation.
Send messageSend message.
Update messaging profileUpdates the supplied settings on the specified messaging profile.

Cancel scheduled message

Cancel scheduled message.

Inputs

Message IDmessage_idtextRequired
The id of the message to cancel

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "cc": [],
    "completed_at": "example",
    "cost": {
      "amount": "example",
      "currency": "example"
    },
    "cost_breakdown": {
      "carrier_fee": {
        "amount": "example",
        "currency": "example"
      },
      "rate": {
        "amount": "example",
        "currency": "example"
      }
    },
    "direction": "outbound",
    "encoding": "example",
    "errors": [],
    "from": {
      "carrier": "example",
      "line_type": "Wireline",
      "phone_number": "example"
    },
    "id": "example",
    "media": [],
    "messaging_profile_id": "example",
    "num_chars": 1,
    "organization_id": "example",
    "parts": 1,
    "received_at": "example",
    "record_type": "message",
    "sent_at": "example",
    "smart_encoding_applied": false,
    "subject": "example",
    "tags": [],
    "tcr_campaign_billable": false,
    "tcr_campaign_id": "example",
    "tcr_campaign_registered": "example",
    "text": "example",
    "to": [],
    "type": "SMS",
    "valid_until": "example",
    "webhook_failover_url": "example",
    "webhook_url": "example"
  }
}

Create messaging profile

Create messaging profile.

Inputs

NamenametextRequired
A user friendly name for the messaging profile.
Whitelisted destinationswhitelisted_destinationslistRequired
Destinations to which the messaging profile is allowed to send. The elements in the list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]` all destinations will be allowed.
Enabledenabledtrue/false
Specifies whether the messaging profile is enabled or not.Default: true.
Webhook URLwebhook_urltext
The URL where webhooks related to this messaging profile will be sent.
Webhook failover URLwebhook_failover_urltext
The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails.
Webhook API versionwebhook_api_versiontext
Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format.One of: 1, 2, 2010-04-01. Default: 2.
Number pool settingsnumber_pool_settingsobject
Number pool settings.
Url shortener settingsurl_shortener_settingsobject
Url shortener settings.
Mm7 metadatamm7_metadataobject
MM7 settings for inbound messages
Alpha senderalpha_sendertext
The alphanumeric sender ID to use when sending to destinations that require an alphanumeric sender ID.
Daily spend limitdaily_spend_limittext
The maximum amount of money (in USD) that can be spent by this profile before midnight UTC.
Daily spend limit enableddaily_spend_limit_enabledtrue/false
Whether to enforce the value configured by `daily_spend_limit`.
Mms fall back to smsmms_fall_back_to_smstrue/false
enables SMS fallback for MMS messages.Default: false.
Mms transcodingmms_transcodingtrue/false
enables automated resizing of MMS media.Default: false.
Mobile onlymobile_onlytrue/false
Send messages only to mobile phone numbers.Default: false.
Smart encodingsmart_encodingtrue/false
Enables automatic character encoding optimization for SMS messages. When enabled, the system automatically selects the most efficient encoding (GSM-7 or UCS-2) based on message content to maximize character limits and minimize costs.Default: false.
Featuresfeaturesobject
Telnyx product features the messaging customer can enable on the messaging profile. Keys map to individual feature flags; unknown keys are accepted and preserved for forward compatibility with rolling deployments.
Resource group IDresource_group_idtext
The resource group ID to associate with this messaging profile.
Health webhook URLhealth_webhook_urltext
A URL to receive health check webhooks for numbers in this profile.
Ai assistant IDai_assistant_idtext
The AI assistant ID to associate with this messaging profile.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": {
      "ai_assistant_id": "example",
      "alpha_sender": "example",
      "created_at": "example",
      "daily_spend_limit": "example",
      "daily_spend_limit_enabled": false,
      "enabled": false,
      "features": {
        "ai_opt_out_detection_enabled": false,
        "auto_chunk_long_messages": false
      },
      "health_webhook_url": "example",
      "id": "example",
      "mm7_metadata": {
        "mm7_failover_webhook_url": "example",
        "mm7_webhook_url": "example"
      },
      "mms_fall_back_to_sms": false,
      "mms_transcoding": false,
      "mobile_only": false,
      "name": "example",
      "number_pool_settings": {
        "geomatch": false,
        "long_code_weight": 1.0,
        "skip_unhealthy": false,
        "sticky_sender": false,
        "toll_free_weight": 1.0
      },
      "organization_id": "example",
      "record_type": "messaging_profile",
      "redaction_enabled": false,
      "redaction_level": 1,
      "resource_group_id": "example",
      "smart_encoding": false,
      "updated_at": "example",
      "url_shortener_settings": {
        "domain": "example",
        "prefix": "example",
        "replace_blacklist_only": false,
        "send_webhooks": false
      },
      "v1_secret": "example",
      "webhook_api_version": "1",
      "webhook_failover_url": "example",
      "webhook_url": "example",
      "whitelisted_destinations": []
    }
  }
}

Delete messaging profile

Deletes the specified messaging profile and returns the profile's final configuration.

Inputs

Messaging profile IDmessaging_profile_idtextRequired
The id of the messaging profile to retrieve

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": {
      "ai_assistant_id": "example",
      "alpha_sender": "example",
      "created_at": "example",
      "daily_spend_limit": "example",
      "daily_spend_limit_enabled": false,
      "enabled": false,
      "features": {
        "ai_opt_out_detection_enabled": false,
        "auto_chunk_long_messages": false
      },
      "health_webhook_url": "example",
      "id": "example",
      "mm7_metadata": {
        "mm7_failover_webhook_url": "example",
        "mm7_webhook_url": "example"
      },
      "mms_fall_back_to_sms": false,
      "mms_transcoding": false,
      "mobile_only": false,
      "name": "example",
      "number_pool_settings": {
        "geomatch": false,
        "long_code_weight": 1.0,
        "skip_unhealthy": false,
        "sticky_sender": false,
        "toll_free_weight": 1.0
      },
      "organization_id": "example",
      "record_type": "messaging_profile",
      "redaction_enabled": false,
      "redaction_level": 1,
      "resource_group_id": "example",
      "smart_encoding": false,
      "updated_at": "example",
      "url_shortener_settings": {
        "domain": "example",
        "prefix": "example",
        "replace_blacklist_only": false,
        "send_webhooks": false
      },
      "v1_secret": "example",
      "webhook_api_version": "1",
      "webhook_failover_url": "example",
      "webhook_url": "example",
      "whitelisted_destinations": []
    }
  }
}

Get balance

Retrieve the current balance, available credit, and credit limit for your account.

Inputs

None.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": {
      "available_credit": "example",
      "balance": "example",
      "credit_limit": "example",
      "currency": "example",
      "pending": "example",
      "record_type": "balance"
    }
  }
}

Get group MMS

Retrieve all messages in a group MMS conversation by the group message ID.

Inputs

Message IDmessage_idtextRequired
The group message ID.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": []
  }
}

Get message

Get message.

Inputs

Message IDmessage_idtextRequired
The id of the message

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": {
      "body": {
        "text": "example"
      },
      "cc": [],
      "child_message_id": "example",
      "completed_at": "example",
      "cost": {
        "amount": "example",
        "currency": "example"
      },
      "cost_breakdown": {
        "carrier_fee": {
          "amount": "example",
          "currency": "example"
        },
        "rate": {
          "amount": "example",
          "currency": "example"
        }
      },
      "direction": "outbound",
      "encoding": "example",
      "errors": [],
      "from": {
        "agent_id": "example",
        "agent_name": "example",
        "carrier": "example",
        "line_type": "Wireline",
        "phone_number": "example"
      },
      "id": "example",
      "media": [],
      "messaging_profile_id": "example",
      "num_chars": 1,
      "organization_id": "example",
      "parent_message_id": "example",
      "parts": 1,
      "received_at": "example",
      "record_type": "message",
      "sent_at": "example",
      "smart_encoding_applied": false,
      "subject": "example",
      "tags": [],
      "tcr_campaign_billable": false,
      "tcr_campaign_id": "example",
      "tcr_campaign_registered": "example",
      "template_id": "example",
      "template_name": "example",
      "text": "example",
      "to": [],
      "type": "SMS",
      "valid_until": "example",
      "wait_seconds": 1.0,
      "webhook_failover_url": "example",
      "webhook_url": "example"
    }
  }
}

Get messaging profile

Returns the complete configuration of the specified messaging profile, including webhook and sender-selection settings.

Inputs

Messaging profilemessaging_profile_idtextRequired
The id of the messaging profile to retrieve

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": {
      "ai_assistant_id": "example",
      "alpha_sender": "example",
      "created_at": "example",
      "daily_spend_limit": "example",
      "daily_spend_limit_enabled": false,
      "enabled": false,
      "features": {
        "ai_opt_out_detection_enabled": false,
        "auto_chunk_long_messages": false
      },
      "health_webhook_url": "example",
      "id": "example",
      "mm7_metadata": {
        "mm7_failover_webhook_url": "example",
        "mm7_webhook_url": "example"
      },
      "mms_fall_back_to_sms": false,
      "mms_transcoding": false,
      "mobile_only": false,
      "name": "example",
      "number_pool_settings": {
        "geomatch": false,
        "long_code_weight": 1.0,
        "skip_unhealthy": false,
        "sticky_sender": false,
        "toll_free_weight": 1.0
      },
      "organization_id": "example",
      "record_type": "messaging_profile",
      "redaction_enabled": false,
      "redaction_level": 1,
      "resource_group_id": "example",
      "smart_encoding": false,
      "updated_at": "example",
      "url_shortener_settings": {
        "domain": "example",
        "prefix": "example",
        "replace_blacklist_only": false,
        "send_webhooks": false
      },
      "v1_secret": "example",
      "webhook_api_version": "1",
      "webhook_failover_url": "example",
      "webhook_url": "example",
      "whitelisted_destinations": []
    }
  }
}

Get phone number

Get phone number.

Inputs

Phone number IDphone_number_idtextRequired
Identifies the resource.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": {
      "activated_at": "example",
      "billing_group_id": "example",
      "call_forwarding_enabled": false,
      "call_recording_enabled": false,
      "caller_id_name_enabled": false,
      "cnam_listing_enabled": false,
      "connection_id": "example",
      "connection_name": "example",
      "country_iso_alpha2": "example",
      "created_at": "example",
      "customer_reference": "example",
      "deletion_lock_enabled": false,
      "emergency_address_id": "example",
      "emergency_enabled": false,
      "emergency_status": "active",
      "external_pin": "example",
      "hd_voice_enabled": false,
      "id": "example",
      "inbound_call_screening": "disabled",
      "messaging_campaign_id": "example",
      "messaging_profile_id": "example",
      "messaging_profile_name": "example",
      "phone_number": "example",
      "phone_number_type": "local",
      "purchased_at": "example",
      "record_type": "example",
      "source_type": "number_order",
      "status": "purchase-pending",
      "t38_fax_gateway_enabled": false,
      "tags": [],
      "updated_at": "example"
    }
  }
}

Get webhook delivery

Provides webhook_delivery debug data, such as timestamps, delivery status and attempts.

Inputs

Webhook delivery IDwebhook_delivery_idtextRequired
Uniquely identifies the webhook_delivery.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": {
      "attempts": [],
      "finished_at": "example",
      "id": "example",
      "record_type": "example",
      "started_at": "example",
      "status": "delivered",
      "user_id": "example",
      "webhook": {
        "event_type": "example",
        "id": "example",
        "occurred_at": "example",
        "payload": {},
        "record_type": "event"
      }
    }
  }
}

List alphanumeric sender IDs

List all alphanumeric sender IDs associated with a specific messaging profile.

Inputs

Messaging profilemessaging_profile_idtextRequired
The identifier of the messaging profile.
Page numberpage_numbernumber
Page number to retrieve (1-based).Default: 1.
Page sizepage_sizenumber
Number of items to return per page.Default: 20.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "page_number": 1,
      "page_size": 1,
      "total_pages": 1,
      "total_results": 1
    }
  }
}

List available phone numbers

List available phone numbers.

Inputs

Filter localityfilter_localitytext
Filter phone numbers by city.
Filter administrative areafilter_administrative_areatext
Find numbers in a particular US state or CA province.
Filter country codefilter_country_codetext
Filter phone numbers by country.
Filter national destination codefilter_national_destination_codetext
Filter by the national destination code of the number.
Filter rate centerfilter_rate_centertext
Filter phone numbers by rate center. This filter is only applicable to USA and Canada numbers.
Filter phone number typefilter_phone_number_typetext
Filter phone numbers by number type.One of: local, toll_free (Toll free), mobile, national, shared_cost (Shared cost).
Filter limitfilter_limitnumber
Limits the number of results.
Filter best effortfilter_best_efforttrue/false
Filter to determine if best effort results should be included. Only available in USA/CANADA.
Filter quickshipfilter_quickshiptrue/false
Filter to exclude phone numbers that need additional time after to purchase to activate. Only applicable for +1 toll_free numbers.
Filter reservablefilter_reservabletrue/false
Filter to ensure only numbers that can be reserved are included in the results.
Filter exclude held numbersfilter_exclude_held_numberstrue/false
Filter to exclude phone numbers that are currently on hold/reserved for your account.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "best_effort_results": 1,
      "total_results": 1
    },
    "metadata": {
      "best_effort_results": 1,
      "total_results": 1
    }
  }
}

List messaging profiles

Lists messaging profiles owned by the authenticated account. Apply the documented filters and pagination parameters to narrow the result set.

Inputs

Filter name eqfilter_name_eqtext
Filter profiles by exact name match.
Filter name containsfilter_name_containstext
Filter profiles by name containing the given string.
Filter namefilter_nametext
Filter by name
Pagepagenumber
The page number to loadAt least 1. Default: 1.
Page sizepage_sizenumber
The size of the pageFrom 1 to 250. Default: 20.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "page_number": 1,
      "page_size": 1,
      "total_pages": 1,
      "total_results": 1
    }
  }
}

List phone numbers

List phone numbers.

Inputs

Sortsorttext
Specifies the sort order for results. If not given, results are sorted by created_at in descending order.One of: purchased_at (Purchased at), phone_number (Phone number), connection_name (Connection name), usage_payment_method (Usage payment method).
Handle messaging profile errorhandle_messaging_profile_errortext
Handle messaging profile error.One of: true, false. Default: false.
Page sizepage_sizenumber
The size of the pageFrom 1 to 250. Default: 20.
Pagepagenumber
The page number to loadAt least 1. Default: 1.
Filter tagfilter_tagtext
Filter by phone number tags.
Filter without tagsfilter_without_tagstext
When set to 'true', filters for phone numbers that do not have any tags applied. All other values are ignored.One of: true, false.
Filter phone numberfilter_phone_numbertext
Filter by phone number. Requires at least three digits. Non-numerical characters will result in no values being returned.
Filter statusfilter_statustext
Filter by phone number status.One of: purchase-pending, purchase-failed, port-pending, active, deleted, port-failed, emergency-only, ported-out, port-out-pending.
Filter connection IDfilter_connection_idtext
Filter by connection_id.
Filter voice usage payment methodfilter_voice_usage_payment_methodtext
Filter by usage_payment_method.One of: pay-per-minute, channel.
Filter billing group IDfilter_billing_group_idtext
Filter by the billing_group_id associated with phone numbers. To filter to only phone numbers that have no billing group associated them, set the value of this filter to the string 'null'.
Filter emergency address IDfilter_emergency_address_idtext
Filter by the emergency_address_id associated with phone numbers. To filter only phone numbers that have no emergency address associated with them, set the value of this filter to the string 'null'.
Filter customer referencefilter_customer_referencetext
Filter numbers via the customer_reference set.
Filter sourcefilter_sourcetext
Filter phone numbers by their source. Use 'ported' for numbers ported from other carriers, or 'purchased' for numbers bought directly from Telnyx.One of: ported, purchased.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": [],
    "errors": [],
    "meta": {
      "page_number": 1,
      "page_size": 1,
      "total_pages": 1,
      "total_results": 1
    }
  }
}

List profile phone numbers

Returns the phone numbers currently associated with the specified messaging profile.

Inputs

Messaging profilemessaging_profile_idtextRequired
The id of the messaging profile to retrieve
Pagepagenumber
The page number to loadAt least 1. Default: 1.
Page sizepage_sizenumber
The size of the pageFrom 1 to 250. Default: 20.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "page_number": 1,
      "page_size": 1,
      "total_pages": 1,
      "total_results": 1
    }
  }
}

List profile short codes

Returns the short codes currently associated with the specified messaging profile.

Inputs

Messaging profilemessaging_profile_idtextRequired
The id of the messaging profile to retrieve
Pagepagenumber
The page number to loadAt least 1. Default: 1.
Page sizepage_sizenumber
The size of the pageFrom 1 to 250. Default: 20.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "page_number": 1,
      "page_size": 1,
      "total_pages": 1,
      "total_results": 1
    }
  }
}

List webhook deliveries

Lists webhook_deliveries for the authenticated user

Inputs

Pagepagenumber
The page number to loadAt least 1. Default: 1.
Page sizepage_sizenumber
The size of the pageFrom 1 to 250. Default: 20.
Filter event typefilter_event_typetext
Return only webhook_deliveries matching the given value of `event_type`. Accepts multiple values separated by a `,`.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": [],
    "meta": {
      "page_number": 1,
      "page_size": 1,
      "total_pages": 1,
      "total_results": 1
    }
  }
}

Schedule message

Schedule message.

Inputs

From numberfrom_numbertext
Sending address (+E.164 formatted phone number, alphanumeric sender ID, or short code). **Required if sending with a phone number, short code, or alphanumeric sender ID.**
Messaging profilemessaging_profile_idtext
Unique identifier for a messaging profile. **Required if sending via number pool or with an alphanumeric sender ID.**
TototextRequired
Receiving address (+E.164 formatted phone number or short code).
Texttexttext
Message body (i.e., content) as a non-empty string. **Required for SMS**
Subjectsubjecttext
Subject of multimedia message
Media URLsmedia_urlslist
A list of media URLs. The total media size must be less than 1 MB. **Required for MMS**
Webhook URLwebhook_urltext
The URL where webhooks related to this message will be sent.
Webhook failover URLwebhook_failover_urltext
The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.
Use profile webhooksuse_profile_webhookstrue/false
If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.Default: true.
Typetypetext
The protocol for sending the message, either SMS or MMS.One of: SMS, MMS.
Auto detectauto_detecttrue/false
Auto detect.Default: false.
Send atsend_atdate and timeRequired
ISO 8601 formatted date indicating when to send the message - accurate up till a minute.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": {
      "body": {
        "text": "example"
      },
      "cc": [],
      "child_message_id": "example",
      "completed_at": "example",
      "cost": {
        "amount": "example",
        "currency": "example"
      },
      "cost_breakdown": {
        "carrier_fee": {
          "amount": "example",
          "currency": "example"
        },
        "rate": {
          "amount": "example",
          "currency": "example"
        }
      },
      "direction": "outbound",
      "encoding": "example",
      "errors": [],
      "from": {
        "agent_id": "example",
        "agent_name": "example",
        "carrier": "example",
        "line_type": "Wireline",
        "phone_number": "example"
      },
      "id": "example",
      "media": [],
      "messaging_profile_id": "example",
      "num_chars": 1,
      "organization_id": "example",
      "parent_message_id": "example",
      "parts": 1,
      "received_at": "example",
      "record_type": "message",
      "sent_at": "example",
      "smart_encoding_applied": false,
      "subject": "example",
      "tags": [],
      "tcr_campaign_billable": false,
      "tcr_campaign_id": "example",
      "tcr_campaign_registered": "example",
      "template_id": "example",
      "template_name": "example",
      "text": "example",
      "to": [],
      "type": "SMS",
      "valid_until": "example",
      "wait_seconds": 1.0,
      "webhook_failover_url": "example",
      "webhook_url": "example"
    }
  }
}

Send group MMS

Queues an MMS addressed to multiple recipients as a group conversation. Delivery events are reported asynchronously through messaging webhooks.

Inputs

Idempotency keyidempotency_keytext
Idempotency key.
From numberfrom_numbertextRequired
Phone number, in +E.164 format, used to send the message.
TotolistRequired
A list of destinations. No more than 8 destinations are allowed.
Texttexttext
Message body (i.e., content) as a non-empty string.
Subjectsubjecttext
Subject of multimedia message
Media URLsmedia_urlslist
A list of media URLs. The total media size must be less than 1 MB.
Webhook URLwebhook_urltext
The URL where webhooks related to this message will be sent.
Webhook failover URLwebhook_failover_urltext
The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.
Use profile webhooksuse_profile_webhookstrue/false
If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.Default: true.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": {
      "body": {
        "text": "example"
      },
      "cc": [],
      "child_message_id": "example",
      "completed_at": "example",
      "cost": {
        "amount": "example",
        "currency": "example"
      },
      "cost_breakdown": {
        "carrier_fee": {
          "amount": "example",
          "currency": "example"
        },
        "rate": {
          "amount": "example",
          "currency": "example"
        }
      },
      "direction": "outbound",
      "encoding": "example",
      "errors": [],
      "from": {
        "agent_id": "example",
        "agent_name": "example",
        "carrier": "example",
        "line_type": "Wireline",
        "phone_number": "example"
      },
      "id": "example",
      "media": [],
      "messaging_profile_id": "example",
      "num_chars": 1,
      "organization_id": "example",
      "parent_message_id": "example",
      "parts": 1,
      "received_at": "example",
      "record_type": "message",
      "sent_at": "example",
      "smart_encoding_applied": false,
      "subject": "example",
      "tags": [],
      "tcr_campaign_billable": false,
      "tcr_campaign_id": "example",
      "tcr_campaign_registered": "example",
      "template_id": "example",
      "template_name": "example",
      "text": "example",
      "to": [],
      "type": "SMS",
      "valid_until": "example",
      "wait_seconds": 1.0,
      "webhook_failover_url": "example",
      "webhook_url": "example"
    }
  }
}

Send message

Send message.

Inputs

Idempotency keyidempotency_keytext
Idempotency key.
From numberfrom_numbertext
Sending address (+E.164 formatted phone number, alphanumeric sender ID, or short code). **Required if sending with a phone number, short code, or alphanumeric sender ID.**
Messaging profilemessaging_profile_idtext
Unique identifier for a messaging profile. **Required if sending via number pool or with an alphanumeric sender ID.**
TototextRequired
Receiving address (+E.164 formatted phone number or short code).
Texttexttext
Message body (i.e., content) as a non-empty string. **Required for SMS**
Subjectsubjecttext
Subject of multimedia message
Media URLsmedia_urlslist
A list of media URLs. The total media size must be less than 1 MB. **Required for MMS**
Webhook URLwebhook_urltext
The URL where webhooks related to this message will be sent.
Webhook failover URLwebhook_failover_urltext
The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.
Use profile webhooksuse_profile_webhookstrue/false
If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.Default: true.
Typetypetext
The protocol for sending the message, either SMS or MMS.One of: SMS, MMS.
Auto detectauto_detecttrue/false
Auto detect.Default: false.
Send atsend_atdate and time
ISO 8601 formatted date indicating when to send the message - accurate up till a minute.
Encodingencodingtext
Encoding.One of: auto, gsm7, ucs2. Default: auto.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": {
      "body": {
        "text": "example"
      },
      "cc": [],
      "child_message_id": "example",
      "completed_at": "example",
      "cost": {
        "amount": "example",
        "currency": "example"
      },
      "cost_breakdown": {
        "carrier_fee": {
          "amount": "example",
          "currency": "example"
        },
        "rate": {
          "amount": "example",
          "currency": "example"
        }
      },
      "direction": "outbound",
      "encoding": "example",
      "errors": [],
      "from": {
        "agent_id": "example",
        "agent_name": "example",
        "carrier": "example",
        "line_type": "Wireline",
        "phone_number": "example"
      },
      "id": "example",
      "media": [],
      "messaging_profile_id": "example",
      "num_chars": 1,
      "organization_id": "example",
      "parent_message_id": "example",
      "parts": 1,
      "received_at": "example",
      "record_type": "message",
      "sent_at": "example",
      "smart_encoding_applied": false,
      "subject": "example",
      "tags": [],
      "tcr_campaign_billable": false,
      "tcr_campaign_id": "example",
      "tcr_campaign_registered": "example",
      "template_id": "example",
      "template_name": "example",
      "text": "example",
      "to": [],
      "type": "SMS",
      "valid_until": "example",
      "wait_seconds": 1.0,
      "webhook_failover_url": "example",
      "webhook_url": "example"
    }
  }
}

Update messaging profile

Updates the supplied settings on the specified messaging profile. Settings omitted from the request remain unchanged.

Inputs

Messaging profile IDmessaging_profile_idtextRequired
The id of the messaging profile to retrieve
Namenametext
A user friendly name for the messaging profile.
Enabledenabledtrue/false
Specifies whether the messaging profile is enabled or not.
Webhook URLwebhook_urltext
The URL where webhooks related to this messaging profile will be sent.
Webhook failover URLwebhook_failover_urltext
The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails.
Webhook API versionwebhook_api_versiontext
Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format.One of: 1, 2, 2010-04-01.
Whitelisted destinationswhitelisted_destinationslist
Whitelisted destinations.
Number pool settingsnumber_pool_settingsobject
Number pool settings.
Url shortener settingsurl_shortener_settingsobject
Url shortener settings.
Mm7 metadatamm7_metadataobject
MM7 settings for inbound messages
Alpha senderalpha_sendertext
The alphanumeric sender ID to use when sending to destinations that require an alphanumeric sender ID.
Daily spend limitdaily_spend_limittext
The maximum amount of money (in USD) that can be spent by this profile before midnight UTC.
Daily spend limit enableddaily_spend_limit_enabledtrue/false
Whether to enforce the value configured by `daily_spend_limit`.
Mms fall back to smsmms_fall_back_to_smstrue/false
enables SMS fallback for MMS messages.Default: false.
Mms transcodingmms_transcodingtrue/false
enables automated resizing of MMS media.Default: false.
Mobile onlymobile_onlytrue/false
Send messages only to mobile phone numbers.Default: false.
Smart encodingsmart_encodingtrue/false
Enables automatic character encoding optimization for SMS messages. When enabled, the system automatically selects the most efficient encoding (GSM-7 or UCS-2) based on message content to maximize character limits and minimize costs.Default: false.
Featuresfeaturesobject
Telnyx product features the messaging customer can enable on the messaging profile. Keys map to individual feature flags; unknown keys are accepted and preserved for forward compatibility with rolling deployments.
Ai assistant IDai_assistant_idtext
The ID of the AI assistant associated with this messaging profile.
Redaction enabledredaction_enabledtrue/false
Set to true to enable message content redaction on this profile, or false to disable it. Ignored if the organization is not on the redaction allowlist. See the [Message Redaction guide](/docs/messaging/messages/message-redaction) for what is redacted.Default: false.
Redaction levelredaction_levelnumber
The redaction level to apply when redaction is enabled. 1: redact message records and reporting only. 2 (default): also redact inbound webhook payloads. See the [Message Redaction guide](/docs/messaging/messages/message-redaction).Default: 2.

Outputs

dataobject
The response from Telnyx.
Example output
{
  "data": {
    "data": {
      "ai_assistant_id": "example",
      "alpha_sender": "example",
      "created_at": "example",
      "daily_spend_limit": "example",
      "daily_spend_limit_enabled": false,
      "enabled": false,
      "features": {
        "ai_opt_out_detection_enabled": false,
        "auto_chunk_long_messages": false
      },
      "health_webhook_url": "example",
      "id": "example",
      "mm7_metadata": {
        "mm7_failover_webhook_url": "example",
        "mm7_webhook_url": "example"
      },
      "mms_fall_back_to_sms": false,
      "mms_transcoding": false,
      "mobile_only": false,
      "name": "example",
      "number_pool_settings": {
        "geomatch": false,
        "long_code_weight": 1.0,
        "skip_unhealthy": false,
        "sticky_sender": false,
        "toll_free_weight": 1.0
      },
      "organization_id": "example",
      "record_type": "messaging_profile",
      "redaction_enabled": false,
      "redaction_level": 1,
      "resource_group_id": "example",
      "smart_encoding": false,
      "updated_at": "example",
      "url_shortener_settings": {
        "domain": "example",
        "prefix": "example",
        "replace_blacklist_only": false,
        "send_webhooks": false
      },
      "v1_secret": "example",
      "webhook_api_version": "1",
      "webhook_failover_url": "example",
      "webhook_url": "example",
      "whitelisted_destinations": []
    }
  }
}

On this page