Build voice applications using TeXML markup language (TwiML-compatible). Manage applications, calls, conferences, recordings, queues, and streams. This skill provides Ruby SDK examples.
Scanned 2/12/2026
Install via CLI
openskills install team-telnyx/telnyx-ext-agent-skills---
name: telnyx-texml-ruby
description: >-
Build voice applications using TeXML markup language (TwiML-compatible).
Manage applications, calls, conferences, recordings, queues, and streams. This
skill provides Ruby SDK examples.
metadata:
author: telnyx
product: texml
language: ruby
---
# Telnyx Texml - Ruby
## Installation
```bash
gem install telnyx
```
## Setup
```ruby
require "telnyx"
client = Telnyx::Client.new(
api_key: ENV["TELNYX_API_KEY"], # This is the default and can be omitted
)
```
All examples below assume `client` is already initialized as shown above.
## List all TeXML Applications
Returns a list of your TeXML Applications.
`GET /texml_applications`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.texml_applications.list
puts(page)
```
## Creates a TeXML Application
Creates a TeXML Application.
`POST /texml_applications` — Required: `friendly_name`, `voice_url`
```ruby
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)
```
## Retrieve a TeXML Application
Retrieves the details of an existing TeXML Application.
`GET /texml_applications/{id}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
texml_application = telnyx.texml_applications.retrieve("1293384261075731499")
puts(texml_application)
```
## Update a TeXML Application
Updates settings of an existing TeXML Application.
`PATCH /texml_applications/{id}` — Required: `friendly_name`, `voice_url`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
texml_application = telnyx.texml_applications.update(
"1293384261075731499",
friendly_name: "call-router",
voice_url: "https://example.com"
)
puts(texml_application)
```
## Deletes a TeXML Application
Deletes a TeXML Application.
`DELETE /texml_applications/{id}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
texml_application = telnyx.texml_applications.delete("1293384261075731499")
puts(texml_application)
```
## Fetch multiple call resources
Returns multiple call resouces for an account.
`GET /texml/Accounts/{account_sid}/Calls`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.retrieve_calls("account_sid")
puts(response)
```
## Initiate an outbound call
Initiate an outbound TeXML call.
`POST /texml/Accounts/{account_sid}/Calls` — Required: `To`, `From`, `ApplicationSid`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.calls(
"account_sid",
application_sid: "example-app-sid",
from: "+13120001234",
to: "+13121230000"
)
puts(response)
```
## Fetch a call
Returns an individual call identified by its CallSid.
`GET /texml/Accounts/{account_sid}/Calls/{call_sid}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
call = telnyx.texml.accounts.calls.retrieve("call_sid", account_sid: "account_sid")
puts(call)
```
## Update call
Update TeXML call.
`POST /texml/Accounts/{account_sid}/Calls/{call_sid}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
call = telnyx.texml.accounts.calls.update("call_sid", account_sid: "account_sid")
puts(call)
```
## List conference participants
Lists conference participants
`GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.conferences.participants.retrieve_participants(
"conference_sid",
account_sid: "account_sid"
)
puts(response)
```
## Dial a new conference participant
Dials a new conference participant
`POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.conferences.participants.participants("conference_sid", account_sid: "account_sid")
puts(response)
```
## Get conference participant resource
Gets conference participant resource
`GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
participant = telnyx.texml.accounts.conferences.participants.retrieve(
"call_sid_or_participant_label",
account_sid: "account_sid",
conference_sid: "conference_sid"
)
puts(participant)
```
## Update a conference participant
Updates a conference participant
`POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
participant = telnyx.texml.accounts.conferences.participants.update(
"call_sid_or_participant_label",
account_sid: "account_sid",
conference_sid: "conference_sid"
)
puts(participant)
```
## Delete a conference participant
Deletes a conference participant
`DELETE /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Participants/{call_sid_or_participant_label}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
result = telnyx.texml.accounts.conferences.participants.delete(
"call_sid_or_participant_label",
account_sid: "account_sid",
conference_sid: "conference_sid"
)
puts(result)
```
## List conference resources
Lists conference resources.
`GET /texml/Accounts/{account_sid}/Conferences`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.conferences.retrieve_conferences("account_sid")
puts(response)
```
## Fetch a conference resource
Returns a conference resource.
`GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
conference = telnyx.texml.accounts.conferences.retrieve("conference_sid", account_sid: "account_sid")
puts(conference)
```
## Update a conference resource
Updates a conference resource.
`POST /texml/Accounts/{account_sid}/Conferences/{conference_sid}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
conference = telnyx.texml.accounts.conferences.update("conference_sid", account_sid: "account_sid")
puts(conference)
```
## List queue resources
Lists queue resources.
`GET /texml/Accounts/{account_sid}/Queues`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.texml.accounts.queues.list("account_sid")
puts(page)
```
## Create a new queue
Creates a new queue resource.
`POST /texml/Accounts/{account_sid}/Queues`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
queue = telnyx.texml.accounts.queues.create("account_sid")
puts(queue)
```
## Fetch a queue resource
Returns a queue resource.
`GET /texml/Accounts/{account_sid}/Queues/{queue_sid}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
queue = telnyx.texml.accounts.queues.retrieve("queue_sid", account_sid: "account_sid")
puts(queue)
```
## Update a queue resource
Updates a queue resource.
`POST /texml/Accounts/{account_sid}/Queues/{queue_sid}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
queue = telnyx.texml.accounts.queues.update("queue_sid", account_sid: "account_sid")
puts(queue)
```
## Delete a queue resource
Delete a queue resource.
`DELETE /texml/Accounts/{account_sid}/Queues/{queue_sid}`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
result = telnyx.texml.accounts.queues.delete("queue_sid", account_sid: "account_sid")
puts(result)
```
## Fetch multiple recording resources
Returns multiple recording resources for an account.
`GET /texml/Accounts/{account_sid}/Recordings.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.retrieve_recordings_json("account_sid")
puts(response)
```
## Fetch recording resource
Returns recording resource identified by recording id.
`GET /texml/Accounts/{account_sid}/Recordings/{recording_sid}.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
texml_get_call_recording_response_body = telnyx.texml.accounts.recordings.json.retrieve_recording_sid_json(
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
account_sid: "account_sid"
)
puts(texml_get_call_recording_response_body)
```
## Delete recording resource
Deletes recording resource identified by recording id.
`DELETE /texml/Accounts/{account_sid}/Recordings/{recording_sid}.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
result = telnyx.texml.accounts.recordings.json.delete_recording_sid_json(
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
account_sid: "account_sid"
)
puts(result)
```
## Fetch recordings for a call
Returns recordings for a call identified by call_sid.
`GET /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.recordings_json.retrieve_recordings_json(
"call_sid",
account_sid: "account_sid"
)
puts(response)
```
## Request recording for a call
Starts recording with specified parameters for call idientified by call_sid.
`POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.recordings_json.recordings_json("call_sid", account_sid: "account_sid")
puts(response)
```
## Update recording on a call
Updates recording resource for particular call.
`POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Recordings/{recording_sid}.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.recordings.recording_sid_json(
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
account_sid: "account_sid",
call_sid: "call_sid"
)
puts(response)
```
## List conference recordings
Lists conference recordings
`GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Recordings`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.conferences.retrieve_recordings("conference_sid", account_sid: "account_sid")
puts(response)
```
## Fetch recordings for a conference
Returns recordings for a conference identified by conference_sid.
`GET /texml/Accounts/{account_sid}/Conferences/{conference_sid}/Recordings.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.conferences.retrieve_recordings_json("conference_sid", account_sid: "account_sid")
puts(response)
```
## Create a TeXML secret
Create a TeXML secret which can be later used as a Dynamic Parameter for TeXML when using Mustache Templates in your TeXML.
`POST /texml/secrets` — Required: `name`, `value`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.secrets(name: "My Secret Name", value: "My Secret Value")
puts(response)
```
## Request siprec session for a call
Starts siprec session with specified parameters for call idientified by call_sid.
`POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Siprec.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.siprec_json("call_sid", account_sid: "account_sid")
puts(response)
```
## Updates siprec session for a call
Updates siprec session identified by siprec_sid.
`POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Siprec/{siprec_sid}.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.siprec.siprec_sid_json(
"siprec_sid",
account_sid: "account_sid",
call_sid: "call_sid"
)
puts(response)
```
## Start streaming media from a call.
Starts streaming media from a call to a specific WebSocket address.
`POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Streams.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.streams_json("call_sid", account_sid: "account_sid")
puts(response)
```
## Update streaming on a call
Updates streaming resource for particular call.
`POST /texml/Accounts/{account_sid}/Calls/{call_sid}/Streams/{streaming_sid}.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.calls.streams.streaming_sid_json(
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
account_sid: "account_sid",
call_sid: "call_sid"
)
puts(response)
```
## List recording transcriptions
Returns multiple recording transcription resources for an account.
`GET /texml/Accounts/{account_sid}/Transcriptions.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.retrieve_transcriptions_json("account_sid")
puts(response)
```
## Fetch a recording transcription resource
Returns the recording transcription resource identified by its ID.
`GET /texml/Accounts/{account_sid}/Transcriptions/{recording_transcription_sid}.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.texml.accounts.transcriptions.json.retrieve_recording_transcription_sid_json(
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
account_sid: "account_sid"
)
puts(response)
```
## Delete a recording transcription
Permanently deletes a recording transcription.
`DELETE /texml/Accounts/{account_sid}/Transcriptions/{recording_transcription_sid}.json`
```ruby
telnyx = Telnyx::Client.new(api_key: "My API Key")
result = telnyx.texml.accounts.transcriptions.json.delete_recording_transcription_sid_json(
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
account_sid: "account_sid"
)
puts(result)
```
---
## Webhooks
The following webhook events are sent to your configured webhook URL.
All webhooks include `telnyx-timestamp` and `telnyx-signature-ed25519` headers for verification (Standard Webhooks compatible).
| Event | Description |
|-------|-------------|
| `TexmlCallAnsweredWebhook` | TeXML Call Answered. Webhook sent when a TeXML call is answered |
| `TexmlCallCompletedWebhook` | TeXML Call Completed. Webhook sent when a TeXML call is completed |
| `TexmlCallInitiatedWebhook` | TeXML Call Initiated. Webhook sent when a TeXML call is initiated |
| `TexmlCallRingingWebhook` | TeXML Call Ringing. Webhook sent when a TeXML call is ringing |
| `TexmlCallAmdWebhook` | TeXML Call AMD. Webhook sent when Answering Machine Detection (AMD) completes during a TeXML call |
| `TexmlCallDtmfWebhook` | TeXML Call DTMF. Webhook sent when a DTMF digit is received during a TeXML call |
| `TexmlGatherWebhook` | TeXML Gather. Webhook sent when a Gather command completes (sent to the action URL) |
| `TexmlHttpRequestWebhook` | TeXML HTTP Request. Webhook sent as response to an HTTP Request instruction |
| `TexmlAiGatherWebhook` | TeXML AI Gather. Webhook sent when AI Gather completes with transcription results |
| `TexmlConferenceJoinWebhook` | TeXML Conference Join. Webhook sent when a participant joins a TeXML conference |
| `TexmlConferenceLeaveWebhook` | TeXML Conference Leave. Webhook sent when a participant leaves a TeXML conference |
| `TexmlConferenceSpeakerWebhook` | TeXML Conference Speaker. Webhook sent when a participant starts or stops speaking in a TeXML conference |
| `TexmlConferenceEndWebhook` | TeXML Conference End. Webhook sent when a TeXML conference ends |
| `TexmlConferenceStartWebhook` | TeXML Conference Start. Webhook sent when a TeXML conference starts |
| `TexmlQueueWebhook` | TeXML Queue. Webhook sent for queue status events (triggered by Enqueue command waitUrl) |
| `TexmlRecordingCompletedWebhook` | TeXML Recording Completed. Webhook sent when a recording is completed during a TeXML call (triggered by recordingStatusCallbackEvent) |
| `TexmlRecordingInProgressWebhook` | TeXML Recording In-Progress. Webhook sent when a recording starts during a TeXML call (triggered by recordingStatusCallbackEvent) |
| `TexmlSiprecWebhook` | TeXML SIPREC. Webhook sent for SIPREC session status updates |
| `TexmlStreamWebhook` | TeXML Stream. Webhook sent for media streaming status updates |
| `TexmlTranscriptionWebhook` | TeXML Transcription. Webhook sent when a recording transcription is completed |
No comments yet. Be the first to comment!