Speak in a meeting session
Sends audio / text-to-speech into a meeting session.
POST
/
meeting_sessions
/
{id}
/
actions
/
speak
Speak in a meeting session
curl --request POST \
--url https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Here are the three decisions from this call.",
"interrupt": false
}
'import requests
url = "https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak"
payload = {
"text": "Here are the three decisions from this call.",
"interrupt": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: 'Here are the three decisions from this call.', interrupt: false})
};
fetch('https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => 'Here are the three decisions from this call.',
'interrupt' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak"
payload := strings.NewReader("{\n \"text\": \"Here are the three decisions from this call.\",\n \"interrupt\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Here are the three decisions from this call.\",\n \"interrupt\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Here are the three decisions from this call.\",\n \"interrupt\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"accepted": true
}
}{
"error": {
"code": "invalid_request",
"message": "request is invalid"
}
}{
"error": {
"code": "unauthorized",
"message": "invalid or missing credentials"
}
}{
"error": {
"code": "forbidden",
"message": "credential is not permitted"
}
}{
"error": {
"code": "not_found",
"message": "meeting session not found"
}
}{
"error": {
"code": "invalid_state",
"message": "only scheduled sessions can be updated"
}
}{
"error": {
"code": "invalid_request",
"message": "request body too large"
}
}{
"error": {
"code": "unsupported_capability",
"message": "avatar video is not supported on platform 'unknown'"
}
}{
"error": {
"code": "auth_overloaded",
"message": "authentication temporarily overloaded"
}
}{
"error": {
"code": "internal_error",
"message": "internal server error"
}
}{
"error": {
"code": "tts_error",
"message": "tts synthesis failed"
}
}{
"error": {
"code": "not_configured",
"message": "required feature is not configured"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier for the meeting session.
Example:
"mtgsess_a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Body
application/json
Text for the bot to speak.
Required string length:
1 - 4000Voice identifier to use for this utterance. When supplied, it overrides the session-default voice configured at creation; otherwise the speak action uses that session default.
Required string length:
1 - 100If true, interrupt any currently playing audio to speak this text immediately.
Response
The speak action was accepted and is being processed.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Speak in a meeting session
curl --request POST \
--url https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Here are the three decisions from this call.",
"interrupt": false
}
'import requests
url = "https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak"
payload = {
"text": "Here are the three decisions from this call.",
"interrupt": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: 'Here are the three decisions from this call.', interrupt: false})
};
fetch('https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => 'Here are the three decisions from this call.',
'interrupt' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak"
payload := strings.NewReader("{\n \"text\": \"Here are the three decisions from this call.\",\n \"interrupt\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Here are the three decisions from this call.\",\n \"interrupt\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/meeting_sessions/{id}/actions/speak")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Here are the three decisions from this call.\",\n \"interrupt\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"accepted": true
}
}{
"error": {
"code": "invalid_request",
"message": "request is invalid"
}
}{
"error": {
"code": "unauthorized",
"message": "invalid or missing credentials"
}
}{
"error": {
"code": "forbidden",
"message": "credential is not permitted"
}
}{
"error": {
"code": "not_found",
"message": "meeting session not found"
}
}{
"error": {
"code": "invalid_state",
"message": "only scheduled sessions can be updated"
}
}{
"error": {
"code": "invalid_request",
"message": "request body too large"
}
}{
"error": {
"code": "unsupported_capability",
"message": "avatar video is not supported on platform 'unknown'"
}
}{
"error": {
"code": "auth_overloaded",
"message": "authentication temporarily overloaded"
}
}{
"error": {
"code": "internal_error",
"message": "internal server error"
}
}{
"error": {
"code": "tts_error",
"message": "tts synthesis failed"
}
}{
"error": {
"code": "not_configured",
"message": "required feature is not configured"
}
}