Skip to main content
POST
/
texml_applications
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

const texmlApplication = await client.texmlApplications.create({
  friendly_name: 'call-router',
  voice_url: 'https://example.com',
});

console.log(texmlApplication.data);
import os
from telnyx import Telnyx

client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
texml_application = client.texml_applications.create(
friendly_name="call-router",
voice_url="https://example.com",
)
print(texml_application.data)
package main

import (
"context"
"fmt"

"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)

func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
texmlApplication, err := client.TexmlApplications.New(context.TODO(), telnyx.TexmlApplicationNewParams{
FriendlyName: "call-router",
VoiceURL: "https://example.com",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", texmlApplication.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.texmlapplications.TexmlApplicationCreateParams;
import com.telnyx.sdk.models.texmlapplications.TexmlApplicationCreateResponse;

public final class Main {
private Main() {}

public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();

TexmlApplicationCreateParams params = TexmlApplicationCreateParams.builder()
.friendlyName("call-router")
.voiceUrl("https://example.com")
.build();
TexmlApplicationCreateResponse texmlApplication = client.texmlApplications().create(params);
}
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

texml_application = telnyx.texml_applications.create(friendly_name: "call-router", voice_url: "https://example.com")

puts(texml_application)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
use Telnyx\CredentialConnections\AnchorsiteOverride;
use Telnyx\CredentialConnections\DtmfType;

$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');

try {
$texmlApplication = $client->texmlApplications->create(
friendlyName: 'call-router',
voiceURL: 'https://example.com',
active: false,
anchorsiteOverride: AnchorsiteOverride::AMSTERDAM_NETHERLANDS,
callCostInWebhooks: false,
dtmfType: DtmfType::INBAND,
firstCommandTimeout: true,
firstCommandTimeoutSecs: 10,
inbound: [
'channelLimit' => 10,
'shakenStirEnabled' => true,
'sipSubdomain' => 'example',
'sipSubdomainReceiveSettings' => 'only_my_connections',
],
outbound: [
'channelLimit' => 10, 'outboundVoiceProfileID' => '1293384261075731499'
],
statusCallback: 'https://example.com',
statusCallbackMethod: 'get',
tags: ['tag1', 'tag2'],
voiceFallbackURL: 'https://fallback.example.com',
voiceMethod: 'get',
);

var_dump($texmlApplication);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx texml-applications create \
--api-key 'My API Key' \
--friendly-name call-router \
--voice-url https://example.com
curl --request POST \
--url https://api.telnyx.com/v2/texml_applications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"friendly_name": "call-router",
"active": false,
"anchorsite_override": "Amsterdam, Netherlands",
"dtmf_type": "Inband",
"first_command_timeout": true,
"first_command_timeout_secs": 10,
"voice_url": "https://example.com",
"voice_fallback_url": "https://fallback.example.com",
"call_cost_in_webhooks": false,
"voice_method": "get",
"status_callback": "https://example.com",
"status_callback_method": "get",
"tags": [
"tag1",
"tag2"
],
"inbound": {
"channel_limit": 10,
"shaken_stir_enabled": true,
"sip_subdomain": "example",
"sip_subdomain_receive_settings": "only_my_connections"
},
"outbound": {
"channel_limit": 10,
"outbound_voice_profile_id": "1293384261075731499"
}
}
'
{
  "data": {
    "id": "1293384261075731499",
    "record_type": "texml_application",
    "active": false,
    "friendly_name": "call-router",
    "anchorsite_override": "Amsterdam, Netherlands",
    "dtmf_type": "Inband",
    "first_command_timeout": true,
    "first_command_timeout_secs": 10,
    "voice_url": "https://example.com",
    "voice_fallback_url": "https://fallback.example.com",
    "call_cost_in_webhooks": false,
    "voice_method": "get",
    "status_callback": "https://example.com",
    "status_callback_method": "get",
    "tags": [
      "tag1",
      "tag2"
    ],
    "inbound": {
      "channel_limit": 10,
      "shaken_stir_enabled": true,
      "sip_subdomain": "example",
      "sip_subdomain_receive_settings": "only_my_connections"
    },
    "outbound": {
      "channel_limit": 10,
      "outbound_voice_profile_id": "1293384261075731499"
    },
    "created_at": "2020-02-02T22:25:27.521Z",
    "updated_at": "2020-02-03T22:25:27.521Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Parameters that can be set when creating a TeXML Application

friendly_name
string
required

A user-assigned name to help manage the application.

Example:

"call-router"

voice_url
string<uri>
required

URL to which Telnyx will deliver your XML Translator webhooks.

Example:

"https://example.com"

active
boolean
default:true

Specifies whether the connection can be used.

Example:

false

anchorsite_override
enum<string>
default:Latency

Latency directs Telnyx to route media through the site with the lowest round-trip time to the user's connection. Telnyx calculates this time using ICMP ping messages. This can be disabled by specifying a site to handle all media.

Available options:
Latency,
Chicago, IL,
Ashburn, VA,
San Jose, CA,
Sydney, Australia,
Amsterdam, Netherlands,
London, UK,
Toronto, Canada,
Vancouver, Canada,
Frankfurt, Germany
Example:

"Amsterdam, Netherlands"

dtmf_type
enum<string>
default:RFC 2833

Sets the type of DTMF digits sent from Telnyx to this Connection. Note that DTMF digits sent to Telnyx will be accepted in all formats.

Available options:
RFC 2833,
Inband,
SIP INFO
Example:

"Inband"

first_command_timeout
boolean
default:false

Specifies whether calls to phone numbers associated with this connection should hangup after timing out.

Example:

true

first_command_timeout_secs
integer
default:30

Specifies how many seconds to wait before timing out a dial command.

Example:

10

tags
string[]

Tags associated with the Texml Application.

Example:
["tag1", "tag2"]
voice_fallback_url
string<uri>

URL to which Telnyx will deliver your XML Translator webhooks if we get an error response from your voice_url.

Example:

"https://fallback.example.com"

call_cost_in_webhooks
boolean
default:false

Specifies if call cost webhooks should be sent for this TeXML Application.

voice_method
enum<string>
default:post

HTTP request method Telnyx will use to interact with your XML Translator webhooks. Either 'get' or 'post'.

Available options:
get,
post
Example:

"get"

status_callback
string<uri>

URL for Telnyx to send requests to containing information about call progress events.

Example:

"https://example.com"

status_callback_method
enum<string>
default:post

HTTP request method Telnyx should use when requesting the status_callback URL.

Available options:
get,
post
Example:

"get"

inbound
object
outbound
object

Response

Successful response

data
Texml Application · object
Example:
{
"id": "1293384261075731499",
"record_type": "texml_application",
"active": false,
"friendly_name": "call-router",
"anchorsite_override": "Amsterdam, Netherlands",
"dtmf_type": "Inband",
"first_command_timeout": true,
"first_command_timeout_secs": 10,
"voice_url": "https://example.com",
"voice_fallback_url": "https://fallback.example.com",
"call_cost_in_webhooks": false,
"voice_method": "get",
"status_callback": "https://example.com",
"status_callback_method": "get",
"tags": ["tag1", "tag2"],
"inbound": {
"channel_limit": 10,
"shaken_stir_enabled": true,
"sip_subdomain": "example",
"sip_subdomain_receive_settings": "only_my_connections"
},
"outbound": {
"channel_limit": 10,
"outbound_voice_profile_id": "1293384261075731499"
},
"created_at": "2020-02-02T22:25:27.521Z",
"updated_at": "2020-02-03T22:25:27.521Z"
}