TeXML is an XML-based markup language used to control calls with Telnyx. It provides the fastest way to get started with Programmable Voice by allowing you to define call behavior in a simple XML document. Within a TeXML file, you specify call instructions using commands known as verbs and nouns. The TeXML Translator processes the file from top to bottom, executing each command sequentially in the order in which it appears.
In this guide, you’ll learn how to write a simple text-to-speech TeXML application using Telnyx Programmable Voice in just five lines of code. Check out our video walkthrough of this tutorial.
Step 1: Set up a Telnyx account, phone number, and TeXML application
This quickstart assumes you’ve already set up your developer account and environment.
Step 2: Create an XML file containing TeXML call instructions
If you already have an XML call instruction file from another provider, skip to Step 3. TeXML Translator will seamlessly interpret your existing verbs and nouns.
Create an empty standard .xml file using your preferred editor.TeXML files contain the following items:
<Response>element — tag defining the body of the TeXML documentverb — an XML tag denoting the action that you want Telnyx to take
noun — the item for the action specified in the associated verb
Our TeXML Translator API documentation contains full details of the currently supported commands.
In this example, we want our application to answer incoming calls, play some speech to the caller, and hang up, so we only need <Say> and <Hangup>.
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML file setup above-->
<!-- The Response element wraps the body and is required -->
<Response>
<!-- You don't need to issue an answer command, start with Say for text to speech -->
<Say>This is TeXML text-to-speech setup in seconds! The call will now hang up.</Say>
<!-- For this example, you want to hangup the call, otherwise there will be silence -->
<Hangup/>
</Response>
Step 3: Make your TeXML file accessible on the internet
You can upload the created file to the TeXML bin storage, so that it is available for the TeXML application. To do that:
Go to the TeXML Bin tab in the Voice -> Settings section on the Mission Control Portal
Select
Create newbuttonAdd a name and the content of the file
Save it. The TeXML instructions will be available under the link provided in the URL field.
Step 5: Dial your Telnyx number
Using your favorite telephony client or your own device, dial the number you purchased in Step 1, which is connected to the TeXML Application we just configured. The call will answer automatically, and you should hear your text-to-speech playing. It’s that simple!
Where to next?
Now that you’ve successfully configured TeXML to handle an incoming call, check out our video guide showing you how to make an outbound call from your Telnyx number using Telnyx API, and play some text-to-speech when that call is answered using the same TeXML file from this example. Be sure you’ve set up an Outbound Voice Profile first.
If you’d prefer to start building with our RESTful API, check out our guide to setting up your development environment. After you’re set up, you can learn how to send commands and receive webhooks.

