Recording start
Start recording the call. Recording will stop on call hang-up, or can be initiated via the Stop Recording command.
Expected Webhooks:
call.recording.savedcall.recording.transcription.savedcall.recording.error
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.calls.actions.startRecording('call_control_id', {
channels: 'single',
format: 'wav',
});
console.log(response.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
)
response = client.calls.actions.start_recording(
call_control_id="call_control_id",
channels="single",
format="wav",
)
print(response.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"),
)
response, err := client.Calls.Actions.StartRecording(
context.TODO(),
"call_control_id",
telnyx.CallActionStartRecordingParams{
Channels: telnyx.CallActionStartRecordingParamsChannelsSingle,
Format: telnyx.CallActionStartRecordingParamsFormatWav,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.calls.actions.ActionStartRecordingParams;
import com.telnyx.sdk.models.calls.actions.ActionStartRecordingResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ActionStartRecordingParams params = ActionStartRecordingParams.builder()
.callControlId("call_control_id")
.channels(ActionStartRecordingParams.Channels.SINGLE)
.format(ActionStartRecordingParams.Format.WAV)
.build();
ActionStartRecordingResponse response = client.calls().actions().startRecording(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.calls.actions.start_recording("call_control_id", channels: :single, format_: :wav)
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->calls->actions->startRecording(
'call_control_id',
channels: 'single',
format: 'wav',
clientState: 'aGF2ZSBhIG5pY2UgZGF5ID1d',
commandID: '891510ac-f3e4-11e8-af5b-de00688a4901',
customFileName: 'my_recording_file_name',
maxLength: 0,
playBeep: true,
recordingTrack: 'outbound',
timeoutSecs: 0,
transcription: true,
transcriptionEngine: 'B',
transcriptionLanguage: 'en',
transcriptionMaxSpeakerCount: 4,
transcriptionMinSpeakerCount: 4,
transcriptionProfanityFilter: true,
transcriptionSpeakerDiarization: true,
trim: 'trim-silence',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx calls:actions start-recording \
--api-key 'My API Key' \
--call-control-id call_control_id \
--channels single \
--format wavcurl --request POST \
--url https://api.telnyx.com/v2/calls/{call_control_id}/actions/record_start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"format": "wav",
"channels": "single",
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"command_id": "891510ac-f3e4-11e8-af5b-de00688a4901",
"play_beep": true,
"max_length": 0,
"timeout_secs": 0,
"transcription": true,
"transcription_engine": "B",
"transcription_language": "en"
}
'{
"data": {
"result": "ok"
}
}Authorizations
Body
Start recording audio request
The number of seconds that Telnyx will wait for the recording to be stopped if silence is detected. The timer only starts when the speech is detected. Please note that call transcription is used to detect silence and the related charge will be applied. The minimum value is 0. The default value is 0 (infinite)
100
The audio track to be recorded. Can be either both, inbound or outbound. If only single track is specified (inbound, outbound), channels configuration is ignored and it will be recorded as mono (single channel).
both, inbound, outbound "outbound"
Silences spoken details of the given kinds in the recording: pci (card number, expiry date, security code), pii (personal details such as names, phone numbers, addresses and other identifying numbers) and phi (health details such as medications, doses and conditions). Redaction works on English speech only. Redacted recordings are charged at the Deepgram speech-to-text rate.
1pci, pii, phi ["pci", "pii"]
Engine to use for speech recognition. A - Google, B - Telnyx, deepgram/nova-3 - Deepgram Nova-3. Note: deepgram/nova-3 supports only en and en-{Region} languages. When redaction is set, leave this out or set a Deepgram engine.
A, B, deepgram/nova-3 "A"
Language code for transcription. Note: Not all languages are supported by all transcription engines (google, telnyx, deepgram). See engine-specific documentation for supported values.
af, af-ZA, am, am-ET, ar, ar-AE, ar-BH, ar-DZ, ar-EG, ar-IL, ar-IQ, ar-JO, ar-KW, ar-LB, ar-MA, ar-MR, ar-OM, ar-PS, ar-QA, ar-SA, ar-TN, ar-YE, as, auto_detect, az, az-AZ, ba, be, bg, bg-BG, bn, bn-BD, bn-IN, bo, br, bs, bs-BA, ca, ca-ES, cs, cs-CZ, cy, da, da-DK, de, de-AT, de-CH, de-DE, el, el-GR, en, en-AU, en-CA, en-GB, en-GH, en-HK, en-IE, en-IN, en-KE, en-NG, en-NZ, en-PH, en-PK, en-SG, en-TZ, en-US, en-ZA, es, es-419, es-AR, es-BO, es-CL, es-CO, es-CR, es-DO, es-EC, es-ES, es-GT, es-HN, es-MX, es-NI, es-PA, es-PE, es-PR, es-PY, es-SV, es-US, es-UY, es-VE, et, et-EE, eu, eu-ES, fa, fa-IR, fi, fi-FI, fil-PH, fo, fr, fr-BE, fr-CA, fr-CH, fr-FR, gl, gl-ES, gu, gu-IN, ha, haw, he, hi, hi-IN, hr, hr-HR, ht, hu, hu-HU, hy, hy-AM, id, id-ID, is, is-IS, it, it-CH, it-IT, iw-IL, ja, ja-JP, jv-ID, jw, ka, ka-GE, kk, kk-KZ, km, km-KH, kn, kn-IN, ko, ko-KR, la, lb, ln, lo, lo-LA, lt, lt-LT, lv, lv-LV, mg, mi, mk, mk-MK, ml, ml-IN, mn, mn-MN, mr, mr-IN, ms, ms-MY, mt, my, my-MM, ne, ne-NP, nl, nl-BE, nl-NL, nn, no, no-NO, oc, pa, pa-Guru-IN, pl, pl-PL, ps, pt, pt-BR, pt-PT, ro, ro-RO, ru, ru-RU, rw-RW, sa, sd, si, si-LK, sk, sk-SK, sl, sl-SI, sn, so, sq, sq-AL, sr, sr-RS, ss-latn-za, st-ZA, su, su-ID, sv, sv-SE, sw, sw-KE, sw-TZ, ta, ta-IN, ta-LK, ta-MY, ta-SG, te, te-IN, tg, th, th-TH, tk, tl, tn-latn-za, tr, tr-TR, ts-ZA, tt, uk, uk-UA, ur, ur-IN, ur-PK, uz, uz-UZ, ve-ZA, vi, vi-VN, xh-ZA, yi, yo, yue-Hant-HK, zh, zh-TW, zu-ZA "en-US"
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.calls.actions.startRecording('call_control_id', {
channels: 'single',
format: 'wav',
});
console.log(response.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
)
response = client.calls.actions.start_recording(
call_control_id="call_control_id",
channels="single",
format="wav",
)
print(response.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"),
)
response, err := client.Calls.Actions.StartRecording(
context.TODO(),
"call_control_id",
telnyx.CallActionStartRecordingParams{
Channels: telnyx.CallActionStartRecordingParamsChannelsSingle,
Format: telnyx.CallActionStartRecordingParamsFormatWav,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.calls.actions.ActionStartRecordingParams;
import com.telnyx.sdk.models.calls.actions.ActionStartRecordingResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ActionStartRecordingParams params = ActionStartRecordingParams.builder()
.callControlId("call_control_id")
.channels(ActionStartRecordingParams.Channels.SINGLE)
.format(ActionStartRecordingParams.Format.WAV)
.build();
ActionStartRecordingResponse response = client.calls().actions().startRecording(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.calls.actions.start_recording("call_control_id", channels: :single, format_: :wav)
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->calls->actions->startRecording(
'call_control_id',
channels: 'single',
format: 'wav',
clientState: 'aGF2ZSBhIG5pY2UgZGF5ID1d',
commandID: '891510ac-f3e4-11e8-af5b-de00688a4901',
customFileName: 'my_recording_file_name',
maxLength: 0,
playBeep: true,
recordingTrack: 'outbound',
timeoutSecs: 0,
transcription: true,
transcriptionEngine: 'B',
transcriptionLanguage: 'en',
transcriptionMaxSpeakerCount: 4,
transcriptionMinSpeakerCount: 4,
transcriptionProfanityFilter: true,
transcriptionSpeakerDiarization: true,
trim: 'trim-silence',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx calls:actions start-recording \
--api-key 'My API Key' \
--call-control-id call_control_id \
--channels single \
--format wavcurl --request POST \
--url https://api.telnyx.com/v2/calls/{call_control_id}/actions/record_start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"format": "wav",
"channels": "single",
"client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
"command_id": "891510ac-f3e4-11e8-af5b-de00688a4901",
"play_beep": true,
"max_length": 0,
"timeout_secs": 0,
"transcription": true,
"transcription_engine": "B",
"transcription_language": "en"
}
'{
"data": {
"result": "ok"
}
}