Skip to main content
POST
/
calls
/
{call_control_id}
/
actions
/
record_start
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: 'My API Key',
});

const response = await client.calls.actions.startRecording('call_control_id', {
  channels: 'single',
  format: 'wav',
});

console.log(response.data);
{
  "data": {
    "result": "ok"
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

call_control_id
string
required

Unique identifier and token for controlling the call

Body

application/json

Start recording audio request

format
enum<string>
required

The audio file format used when storing the call recording. Can be either mp3 or wav.

Available options:
wav,
mp3
Example:

"mp3"

channels
enum<string>
required

When dual, final audio file will be stereo recorded with the first leg on channel A, and the rest on channel B.

Available options:
single,
dual
Example:

"single"

client_state
string

Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.

Example:

"aGF2ZSBhIG5pY2UgZGF5ID1d"

command_id
string

Use this field to avoid duplicate commands. Telnyx will ignore any command with the same command_id for the same call_control_id.

Example:

"891510ac-f3e4-11e8-af5b-de00688a4901"

play_beep
boolean

If enabled, a beep sound will be played at the start of a recording.

Example:

true

max_length
integer<int32>
default:0

Defines the maximum length for the recording in seconds. The minimum value is 0. The maximum value is 14400. The default value is 0 (infinite)

Example:

100

timeout_secs
integer<int32>
default:0

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)

Example:

100

recording_track
enum<string>
default:both

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).

Available options:
both,
inbound,
outbound
Example:

"outbound"

trim
enum<string>

When set to trim-silence, silence will be removed from the beginning and end of the recording.

Available options:
trim-silence
Example:

"trim-silence"

custom_file_name
string

The custom recording file name to be used instead of the default call_leg_id. Telnyx will still add a Unix timestamp suffix.

Required string length: 1 - 40
Example:

"my_recording_file_name"

transcription
boolean
default:false

Enable post recording transcription. The default value is false.

Example:

true

transcription_engine
string
default:A

Engine to use for speech recognition. A - Google

Example:

"A"

transcription_language
enum<string>
default:en-US

Language to use for speech recognition

Available options:
af-ZA,
am-ET,
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,
az-AZ,
bg-BG,
bn-BD,
bn-IN,
bs-BA,
ca-ES,
cs-CZ,
da-DK,
de-AT,
de-CH,
de-DE,
el-GR,
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-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-EE,
eu-ES,
fa-IR,
fi-FI,
fil-PH,
fr-BE,
fr-CA,
fr-CH,
fr-FR,
gl-ES,
gu-IN,
hi-IN,
hr-HR,
hu-HU,
hy-AM,
id-ID,
is-IS,
it-CH,
it-IT,
iw-IL,
ja-JP,
jv-ID,
ka-GE,
kk-KZ,
km-KH,
kn-IN,
ko-KR,
lo-LA,
lt-LT,
lv-LV,
mk-MK,
ml-IN,
mn-MN,
mr-IN,
ms-MY,
my-MM,
ne-NP,
nl-BE,
nl-NL,
no-NO,
pa-Guru-IN,
pl-PL,
pt-BR,
pt-PT,
ro-RO,
ru-RU,
rw-RW,
si-LK,
sk-SK,
sl-SI,
sq-AL,
sr-RS,
ss-latn-za,
st-ZA,
su-ID,
sv-SE,
sw-KE,
sw-TZ,
ta-IN,
ta-LK,
ta-MY,
ta-SG,
te-IN,
th-TH,
tn-latn-za,
tr-TR,
ts-ZA,
uk-UA,
ur-IN,
ur-PK,
uz-UZ,
ve-ZA,
vi-VN,
xh-ZA,
yue-Hant-HK,
zh,
zh-TW,
zu-ZA
Example:

"en-US"

transcription_profanity_filter
boolean
default:false

Enables profanity_filter. Applies to google engine only.

Example:

true

transcription_speaker_diarization
boolean
default:false

Enables speaker diarization. Applies to google engine only.

Example:

true

transcription_min_speaker_count
integer<int32>
default:2

Defines minimum number of speakers in the conversation. Applies to google engine only.

Example:

4

transcription_max_speaker_count
integer<int32>
default:6

Defines maximum number of speakers in the conversation. Applies to google engine only.

Example:

4

Response

Successful response upon making a call control command.

data
Call Control Command Result · object
Example:
{ "result": "ok" }