This is the current API V1 documentation. Explore our API V2 beta if you’d like to test new features.

Docs

Twexit APItwexit-api

Overviewoverview

The Twexit API allows users to send messages and receive message notifications with minimal changes to existing Twilio messaging code. This makes it easier than ever to leave Twilio and begin utilizing Telnyx to send and receive text messages.

Portal Setupportal-setup

Start by creating a new messaging profile account on your Telnyx Portal, and set the API version to “Twexit API”. Then assign an SMS-capable number to that messaging profile.

Send a Messagesend-a-message

To begin sending messages, simply change the following fields in your code:

Initially, only a subset of parameters will be processed by Telnyx. The remaining attributes will be accepted by the API, but ignored:

Request Parametersrequest-parameters

ParameterProcessed by Telnyx in Wrapper v1?Required or Optional
FromYesRequired
ToYesRequired
BodyYesRequired
StatusCallbackYesOptional
applicationSidNoN/A
forceDeliveryNoN/A
maxPriceNoN/A
mediaUrlNoN/A
messagingServiceSidNoN/A
provideFeedbackNoN/A
validityPeriodNoN/A
smartEncodedNoN/A

Responseresponse

ParameterIncluded in Telnyx Response?
account_sidYes
api_versionYes
bodyYes
date_createdYes
date_sentYes (as null)
date_updatedYes
directionYes
error_codeYes (as null)
error_messageYes (as null)
fromYes
messaging_service_sidYes
num_mediaYes
num_segmentsYes
priceYes (as null)
price_unitYes
sidYes
statusYes
subresource_urisYes
toYes
uriYes
telnyx_errorsNo

Delivery Receipt Responsedelivery-receipt-response

ParameterIncluded in Telnyx Response?
AccountSidYes
ApiVersionYes
FromYes
MessageSidYes
MessageStatusYes
SmsSidYes
ToYes
BodyNo
MediaContentTypeNo
MediaUrlNo
MessagingServiceSidNo
NumMediaNo
TelnyxErrorCodeNo
ErrorCodeNo

Inbound Message Notificationsinbound-message-notifications

Telnyx Inbound Message notifications will be in the same format as those sent by Twilio and will be sent to the inbound webhook URL set on the messaging profile. Below are the fields Telnyx currently includes:

ParameterIncluded in Telnyx Response?
AccountSidYes
ApiVersionYes
BodyYes
FromYes
MessageSidYes
NumMediaYes
NumSegmentsYes
SmsMessageSidYes
SmsSidYes
SmsStatusYes
ToYes
FromCityNo
FromCountryNo
FromStateNo
FromZipNo
ToCityNo
ToCountryNo
ToStateNo
ToZipNo