telnyx-voice-conferencing-javascript
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- 由Telnyx OpenAPI规范自动生成,请勿编辑。 -->
Telnyx Voice Conferencing - JavaScript
Telnyx 语音会议 - JavaScript
Installation
安装
bash
npm install telnyxbash
npm install telnyxSetup
初始化设置
javascript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});All examples below assume is already initialized as shown above.
clientjavascript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // 这是默认配置,可省略
});以下所有示例均假设已按照上述方式完成初始化。
clientError Handling
错误处理
All API calls can fail with network errors, rate limits (429), validation errors (422),
or authentication errors (401). Always handle errors in production code:
javascript
try {
const result = await client.messages.send({ to: '+13125550001', from: '+13125550002', text: 'Hello' });
} catch (err) {
if (err instanceof Telnyx.APIConnectionError) {
console.error('Network error — check connectivity and retry');
} else if (err instanceof Telnyx.RateLimitError) {
// 429: rate limited — wait and retry with exponential backoff
const retryAfter = err.headers?.['retry-after'] || 1;
await new Promise(r => setTimeout(r, retryAfter * 1000));
} else if (err instanceof Telnyx.APIError) {
console.error(`API error ${err.status}: ${err.message}`);
if (err.status === 422) {
console.error('Validation error — check required fields and formats');
}
}
}Common error codes: invalid API key, insufficient permissions,
resource not found, validation error (check field formats),
rate limited (retry with exponential backoff).
401403404422429所有API调用可能因网络错误、速率限制(429)、验证错误(422)或身份验证错误(401)而失败。生产环境代码中务必处理错误:
javascript
try {
const result = await client.messages.send({ to: '+13125550001', from: '+13125550002', text: 'Hello' });
} catch (err) {
if (err instanceof Telnyx.APIConnectionError) {
console.error('Network error — check connectivity and retry');
} else if (err instanceof Telnyx.RateLimitError) {
// 429: 速率限制 — 等待后使用指数退避策略重试
const retryAfter = err.headers?.['retry-after'] || 1;
await new Promise(r => setTimeout(r, retryAfter * 1000));
} else if (err instanceof Telnyx.APIError) {
console.error(`API error ${err.status}: ${err.message}`);
if (err.status === 422) {
console.error('Validation error — check required fields and formats');
}
}
}常见错误码: 无效API密钥, 权限不足, 资源未找到, 验证错误(检查字段格式), 速率限制(使用指数退避策略重试)。
401403404422429Important Notes
重要说明
- Pagination: List methods return an auto-paginating iterator. Use to iterate through all pages automatically.
for await (const item of result) { ... }
- 分页处理: 列表类方法会返回自动分页的迭代器。使用可自动遍历所有分页内容。
for await (const item of result) { ... }
Enqueue call
将呼叫加入队列
Put the call in a queue.
POST /calls/{call_control_id}/actions/enqueuequeue_nameOptional: (string), (string), (boolean), (integer), (integer)
client_statecommand_idkeep_after_hangupmax_sizemax_wait_time_secsjavascript
const response = await client.calls.actions.enqueue('call_control_id', { queue_name: 'support' });
console.log(response.data);Returns: (string)
result将呼叫放入队列。
POST /calls/{call_control_id}/actions/enqueuequeue_name可选参数:(字符串)、(字符串)、(布尔值)、(整数)、(整数)
client_statecommand_idkeep_after_hangupmax_sizemax_wait_time_secsjavascript
const response = await client.calls.actions.enqueue('call_control_id', { queue_name: 'support' });
console.log(response.data);返回值:(字符串)
resultRemove call from a queue
将呼叫移出队列
Removes the call from a queue.
POST /calls/{call_control_id}/actions/leave_queueOptional: (string), (string)
client_statecommand_idjavascript
const response = await client.calls.actions.leaveQueue('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);Returns: (string)
result将呼叫从队列中移除。
POST /calls/{call_control_id}/actions/leave_queue可选参数:(字符串)、(字符串)
client_statecommand_idjavascript
const response = await client.calls.actions.leaveQueue('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');
console.log(response.data);返回值:(字符串)
resultList conferences
列出会议列表
Lists conferences. Conferences are created on demand, and will expire after all participants have left the conference or after 4 hours regardless of the number of active participants. Conferences are listed in descending order by .
expires_atGET /conferencesjavascript
// Automatically fetches more pages as needed.
for await (const conference of client.conferences.list()) {
console.log(conference.id);
}Returns: (string), (string), (enum: all_left, ended_via_api, host_left, time_exceeded), (object), (string), (string), (string), (enum: conference), (string), (enum: init, in_progress, completed), (string)
connection_idcreated_atend_reasonended_byexpires_atidnamerecord_typeregionstatusupdated_at列出所有会议。会议会按需创建,当所有参与者离开会议后或无论活跃参与者数量多少,超过4小时后会议将过期。会议按降序排列。
expires_atGET /conferencesjavascript
// 自动按需获取更多分页内容。
for await (const conference of client.conferences.list()) {
console.log(conference.id);
}返回字段:(字符串)、(字符串)、(枚举值:all_left, ended_via_api, host_left, time_exceeded)、(对象)、(字符串)、(字符串)、(字符串)、(枚举值:conference)、(字符串)、(枚举值:init, in_progress, completed)、(字符串)
connection_idcreated_atend_reasonended_byexpires_atidnamerecord_typeregionstatusupdated_atCreate conference
创建会议
Create a conference from an existing call leg using a and a conference name. Upon creating the conference, the call will be automatically bridged to the conference. Conferences will expire after all participants have left the conference or after 4 hours regardless of the number of active participants.
call_control_idPOST /conferencescall_control_idnameOptional: (enum: always, never, on_enter, on_exit), (string), (boolean), (string), (integer), (string), (string), (integer), (enum: Australia, Europe, Middle East, US), (boolean)
beep_enabledclient_statecomfort_noisecommand_idduration_minuteshold_audio_urlhold_media_namemax_participantsregionstart_conference_on_createjavascript
const conference = await client.conferences.create({
call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
name: 'Business',
});
console.log(conference.data);Returns: (string), (string), (enum: all_left, ended_via_api, host_left, time_exceeded), (object), (string), (string), (string), (enum: conference), (string), (enum: init, in_progress, completed), (string)
connection_idcreated_atend_reasonended_byexpires_atidnamerecord_typeregionstatusupdated_at使用现有呼叫链路的和会议名称创建会议。创建会议后,该呼叫将自动接入会议。当所有参与者离开会议后或无论活跃参与者数量多少,超过4小时后会议将过期。
call_control_idPOST /conferencescall_control_idname可选参数:(枚举值:always, never, on_enter, on_exit)、(字符串)、(布尔值)、(字符串)、(整数)、(字符串)、(字符串)、(整数)、(枚举值:Australia, Europe, Middle East, US)、(布尔值)
beep_enabledclient_statecomfort_noisecommand_idduration_minuteshold_audio_urlhold_media_namemax_participantsregionstart_conference_on_createjavascript
const conference = await client.conferences.create({
call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
name: 'Business',
});
console.log(conference.data);返回字段:(字符串)、(字符串)、(枚举值:all_left, ended_via_api, host_left, time_exceeded)、(对象)、(字符串)、(字符串)、(字符串)、(枚举值:conference)、(字符串)、(枚举值:init, in_progress, completed)、(字符串)
connection_idcreated_atend_reasonended_byexpires_atidnamerecord_typeregionstatusupdated_atList conference participants
列出会议参与者
Lists conference participants
GET /conferences/{conference_id}/participantsjavascript
// Automatically fetches more pages as needed.
for await (const conferenceListParticipantsResponse of client.conferences.listParticipants(
'conference_id',
)) {
console.log(conferenceListParticipantsResponse.id);
}Returns: (string), (string), (object), (string), (boolean), (string), (boolean), (boolean), (enum: participant), (boolean), (enum: joining, joined, left), (string), (array[string])
call_control_idcall_leg_idconferencecreated_atend_conference_on_exitidmutedon_holdrecord_typesoft_end_conference_on_exitstatusupdated_atwhisper_call_control_ids列出会议的所有参与者
GET /conferences/{conference_id}/participantsjavascript
// 自动按需获取更多分页内容。
for await (const conferenceListParticipantsResponse of client.conferences.listParticipants(
'conference_id',
)) {
console.log(conferenceListParticipantsResponse.id);
}返回字段:(字符串)、(字符串)、(对象)、(字符串)、(布尔值)、(字符串)、(布尔值)、(布尔值)、(枚举值:participant)、(布尔值)、(枚举值:joining, joined, left)、(字符串)、(字符串数组)
call_control_idcall_leg_idconferencecreated_atend_conference_on_exitidmutedon_holdrecord_typesoft_end_conference_on_exitstatusupdated_atwhisper_call_control_idsRetrieve a conference
获取会议详情
Retrieve an existing conference
GET /conferences/{id}javascript
const conference = await client.conferences.retrieve('550e8400-e29b-41d4-a716-446655440000');
console.log(conference.data);Returns: (string), (string), (enum: all_left, ended_via_api, host_left, time_exceeded), (object), (string), (string), (string), (enum: conference), (string), (enum: init, in_progress, completed), (string)
connection_idcreated_atend_reasonended_byexpires_atidnamerecord_typeregionstatusupdated_at获取现有会议的详细信息
GET /conferences/{id}javascript
const conference = await client.conferences.retrieve('550e8400-e29b-41d4-a716-446655440000');
console.log(conference.data);返回字段:(字符串)、(字符串)、(枚举值:all_left, ended_via_api, host_left, time_exceeded)、(对象)、(字符串)、(字符串)、(字符串)、(枚举值:conference)、(字符串)、(枚举值:init, in_progress, completed)、(字符串)
connection_idcreated_atend_reasonended_byexpires_atidnamerecord_typeregionstatusupdated_atEnd a conference
结束会议
End a conference and terminate all active participants.
POST /conferences/{id}/actions/endOptional: (string)
command_idjavascript
const response = await client.conferences.actions.endConference(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response.data);Returns: (string)
result结束会议并终止所有活跃参与者的呼叫。
POST /conferences/{id}/actions/end可选参数:(字符串)
command_idjavascript
const response = await client.conferences.actions.endConference(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response.data);返回值:(字符串)
resultGather DTMF using audio prompt in a conference
在会议中通过音频提示收集DTMF信号
Play an audio file to a specific conference participant and gather DTMF input.
POST /conferences/{id}/actions/gather_using_audiocall_control_idOptional: (string), (string), (string), (integer), (integer), (string), (string), (integer), (integer), (string), (integer), (boolean), (string), (integer), (string)
audio_urlclient_stategather_idinitial_timeout_millisinter_digit_timeout_millisinvalid_audio_urlinvalid_media_namemaximum_digitsmaximum_triesmedia_nameminimum_digitsstop_playback_on_dtmfterminating_digittimeout_millisvalid_digitsjavascript
const response = await client.conferences.actions.gatherDtmfAudio(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg' },
);
console.log(response.data);Returns: (string)
result向特定会议参与者播放音频文件并收集DTMF输入。
POST /conferences/{id}/actions/gather_using_audiocall_control_id可选参数:(字符串)、(字符串)、(字符串)、(整数)、(整数)、(字符串)、(字符串)、(整数)、(整数)、(字符串)、(整数)、(布尔值)、(字符串)、(整数)、(字符串)
audio_urlclient_stategather_idinitial_timeout_millisinter_digit_timeout_millisinvalid_audio_urlinvalid_media_namemaximum_digitsmaximum_triesmedia_nameminimum_digitsstop_playback_on_dtmfterminating_digittimeout_millisvalid_digitsjavascript
const response = await client.conferences.actions.gatherDtmfAudio(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg' },
);
console.log(response.data);返回值:(字符串)
resultHold conference participants
置休会议参与者
Hold a list of participants in a conference call
POST /conferences/{id}/actions/holdOptional: (string), (array[string]), (string), (enum: Australia, Europe, Middle East, US)
audio_urlcall_control_idsmedia_nameregionjavascript
const response = await client.conferences.actions.hold('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);Returns: (string)
result将会议中的指定参与者置休
POST /conferences/{id}/actions/hold可选参数:(字符串)、(字符串数组)、(字符串)、(枚举值:Australia, Europe, Middle East, US)
audio_urlcall_control_idsmedia_nameregionjavascript
const response = await client.conferences.actions.hold('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);返回值:(字符串)
resultJoin a conference
加入会议
Join an existing call leg to a conference. Issue the Join Conference command with the conference ID in the path and the of the leg you wish to join to the conference as an attribute. The conference can have up to a certain amount of active participants, as set by the parameter in conference creation request.
call_control_idmax_participantsPOST /conferences/{id}/actions/joincall_control_idOptional: (enum: always, never, on_enter, on_exit), (string), (string), (boolean), (boolean), (string), (string), (boolean), (enum: Australia, Europe, Middle East, US), (boolean), (boolean), (enum: barge, monitor, none, whisper), (array[string])
beep_enabledclient_statecommand_idend_conference_on_exitholdhold_audio_urlhold_media_namemuteregionsoft_end_conference_on_exitstart_conference_on_entersupervisor_rolewhisper_call_control_idsjavascript
const response = await client.conferences.actions.join('id', {
call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
});
console.log(response.data);Returns: (string)
result将现有呼叫链路接入会议。使用路径中的会议ID和要接入会议的呼叫链路的作为属性发起加入会议命令。会议的最大活跃参与者数量由创建会议请求中的参数设置。
call_control_idmax_participantsPOST /conferences/{id}/actions/joincall_control_id可选参数:(枚举值:always, never, on_enter, on_exit)、(字符串)、(字符串)、(布尔值)、(布尔值)、(字符串)、(字符串)、(布尔值)、(枚举值:Australia, Europe, Middle East, US)、(布尔值)、(布尔值)、(枚举值:barge, monitor, none, whisper)、(字符串数组)
beep_enabledclient_statecommand_idend_conference_on_exitholdhold_audio_urlhold_media_namemuteregionsoft_end_conference_on_exitstart_conference_on_entersupervisor_rolewhisper_call_control_idsjavascript
const response = await client.conferences.actions.join('id', {
call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
});
console.log(response.data);返回值:(字符串)
resultLeave a conference
离开会议
Removes a call leg from a conference and moves it back to parked state. Expected Webhooks:
conference.participant.left
POST /conferences/{id}/actions/leavecall_control_idOptional: (enum: always, never, on_enter, on_exit), (string), (enum: Australia, Europe, Middle East, US)
beep_enabledcommand_idregionjavascript
const response = await client.conferences.actions.leave('id', {
call_control_id: 'c46e06d7-b78f-4b13-96b6-c576af9640ff',
});
console.log(response.data);Returns: (string)
result将呼叫链路从会议中移除并移至驻留状态。预期Webhook事件:
conference.participant.left
POST /conferences/{id}/actions/leavecall_control_id可选参数:(枚举值:always, never, on_enter, on_exit)、(字符串)、(枚举值:Australia, Europe, Middle East, US)
beep_enabledcommand_idregionjavascript
const response = await client.conferences.actions.leave('id', {
call_control_id: 'c46e06d7-b78f-4b13-96b6-c576af9640ff',
});
console.log(response.data);返回值:(字符串)
resultMute conference participants
静音会议参与者
Mute a list of participants in a conference call
POST /conferences/{id}/actions/muteOptional: (array[string]), (enum: Australia, Europe, Middle East, US)
call_control_idsregionjavascript
const response = await client.conferences.actions.mute('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);Returns: (string)
result将会议中的指定参与者静音
POST /conferences/{id}/actions/mute可选参数:(字符串数组)、(枚举值:Australia, Europe, Middle East, US)
call_control_idsregionjavascript
const response = await client.conferences.actions.mute('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);返回值:(字符串)
resultPlay audio to conference participants
向会议参与者播放音频
Play audio to all or some participants on a conference call.
POST /conferences/{id}/actions/playOptional: (string), (array[string]), (string), (string), (enum: Australia, Europe, Middle East, US)
audio_urlcall_control_idsloopmedia_nameregionjavascript
const response = await client.conferences.actions.play('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);Returns: (string)
result向会议中的全部或部分参与者播放音频。
POST /conferences/{id}/actions/play可选参数:(字符串)、(字符串数组)、(字符串)、(字符串)、(枚举值:Australia, Europe, Middle East, US)
audio_urlcall_control_idsloopmedia_nameregionjavascript
const response = await client.conferences.actions.play('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);返回值:(字符串)
resultConference recording pause
暂停会议录制
Pause conference recording.
POST /conferences/{id}/actions/record_pauseOptional: (string), (string), (enum: Australia, Europe, Middle East, US)
command_idrecording_idregionjavascript
const response = await client.conferences.actions.recordPause('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);Returns: (string)
result暂停会议录制。
POST /conferences/{id}/actions/record_pause可选参数:(字符串)、(字符串)、(枚举值:Australia, Europe, Middle East, US)
command_idrecording_idregionjavascript
const response = await client.conferences.actions.recordPause('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);返回值:(字符串)
resultConference recording resume
恢复会议录制
Resume conference recording.
POST /conferences/{id}/actions/record_resumeOptional: (string), (string), (enum: Australia, Europe, Middle East, US)
command_idrecording_idregionjavascript
const response = await client.conferences.actions.recordResume('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);Returns: (string)
result恢复会议录制。
POST /conferences/{id}/actions/record_resume可选参数:(字符串)、(字符串)、(枚举值:Australia, Europe, Middle East, US)
command_idrecording_idregionjavascript
const response = await client.conferences.actions.recordResume('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);返回值:(字符串)
resultConference recording start
开始会议录制
Start recording the conference. Recording will stop on conference end, or via the Stop Recording command. Expected Webhooks:
conference.recording.saved
POST /conferences/{id}/actions/record_startformatOptional: (enum: single, dual), (string), (string), (boolean), (enum: Australia, Europe, Middle East, US), (enum: trim-silence)
channelscommand_idcustom_file_nameplay_beepregiontrimjavascript
const response = await client.conferences.actions.recordStart('id', { format: 'wav' });
console.log(response.data);Returns: (string)
result开始录制会议。录制将在会议结束时或通过停止录制命令停止。预期Webhook事件:
conference.recording.saved
POST /conferences/{id}/actions/record_startformat可选参数:(枚举值:single, dual)、(字符串)、(字符串)、(布尔值)、(枚举值:Australia, Europe, Middle East, US)、(枚举值:trim-silence)
channelscommand_idcustom_file_nameplay_beepregiontrimjavascript
const response = await client.conferences.actions.recordStart('id', { format: 'wav' });
console.log(response.data);返回值:(字符串)
resultConference recording stop
停止会议录制
Stop recording the conference. Expected Webhooks:
conference.recording.saved
POST /conferences/{id}/actions/record_stopOptional: (string), (string), (uuid), (enum: Australia, Europe, Middle East, US)
client_statecommand_idrecording_idregionjavascript
const response = await client.conferences.actions.recordStop('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);Returns: (string)
result停止录制会议。预期Webhook事件:
conference.recording.saved
POST /conferences/{id}/actions/record_stop可选参数:(字符串)、(字符串)、(uuid)、(枚举值:Australia, Europe, Middle East, US)
client_statecommand_idrecording_idregionjavascript
const response = await client.conferences.actions.recordStop('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);返回值:(字符串)
resultSend DTMF to conference participants
向会议参与者发送DTMF信号
Send DTMF tones to one or more conference participants.
POST /conferences/{id}/actions/send_dtmfdigitsOptional: (array[string]), (string), (integer)
call_control_idsclient_stateduration_millisjavascript
const response = await client.conferences.actions.sendDtmf('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
digits: '1234#',
});
console.log(response.data);Returns: (string)
result向一个或多个会议参与者发送DTMF信号。
POST /conferences/{id}/actions/send_dtmfdigits可选参数:(字符串数组)、(字符串)、(整数)
call_control_idsclient_stateduration_millisjavascript
const response = await client.conferences.actions.sendDtmf('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
digits: '1234#',
});
console.log(response.data);返回值:(字符串)
resultSpeak text to conference participants
向会议参与者播放文本转语音内容
Convert text to speech and play it to all or some participants.
POST /conferences/{id}/actions/speakpayloadvoiceOptional: (array[string]), (string), (enum: arb, cmn-CN, cy-GB, da-DK, de-DE, en-AU, en-GB, en-GB-WLS, en-IN, en-US, es-ES, es-MX, es-US, fr-CA, fr-FR, hi-IN, is-IS, it-IT, ja-JP, ko-KR, nb-NO, nl-NL, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, sv-SE, tr-TR), (enum: text, ssml), (enum: Australia, Europe, Middle East, US), (object)
call_control_idscommand_idlanguagepayload_typeregionvoice_settingsjavascript
const response = await client.conferences.actions.speak('id', {
payload: 'Say this to participants',
voice: 'female',
});
console.log(response.data);Returns: (string)
result将文本转换为语音并播放给全部或部分参与者。
POST /conferences/{id}/actions/speakpayloadvoice可选参数:(字符串数组)、(字符串)、(枚举值:arb, cmn-CN, cy-GB, da-DK, de-DE, en-AU, en-GB, en-GB-WLS, en-IN, en-US, es-ES, es-MX, es-US, fr-CA, fr-FR, hi-IN, is-IS, it-IT, ja-JP, ko-KR, nb-NO, nl-NL, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, sv-SE, tr-TR)、(枚举值:text, ssml)、(枚举值:Australia, Europe, Middle East, US)、(对象)
call_control_idscommand_idlanguagepayload_typeregionvoice_settingsjavascript
const response = await client.conferences.actions.speak('id', {
payload: 'Say this to participants',
voice: 'female',
});
console.log(response.data);返回值:(字符串)
resultStop audio being played on the conference
停止会议中的音频播放
Stop audio being played to all or some participants on a conference call.
POST /conferences/{id}/actions/stopOptional: (array[string]), (enum: Australia, Europe, Middle East, US)
call_control_idsregionjavascript
const response = await client.conferences.actions.stop('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);Returns: (string)
result停止向会议中的全部或部分参与者播放音频。
POST /conferences/{id}/actions/stop可选参数:(字符串数组)、(枚举值:Australia, Europe, Middle East, US)
call_control_idsregionjavascript
const response = await client.conferences.actions.stop('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);返回值:(字符串)
resultUnhold conference participants
取消参与者置休
Unhold a list of participants in a conference call
POST /conferences/{id}/actions/unholdcall_control_idsOptional: (enum: Australia, Europe, Middle East, US)
regionjavascript
const response = await client.conferences.actions.unhold('id', {
call_control_ids: ['v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg'],
});
console.log(response.data);Returns: (string)
result取消会议中指定参与者的置休状态
POST /conferences/{id}/actions/unholdcall_control_ids可选参数:(枚举值:Australia, Europe, Middle East, US)
regionjavascript
const response = await client.conferences.actions.unhold('id', {
call_control_ids: ['v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg'],
});
console.log(response.data);返回值:(字符串)
resultUnmute conference participants
取消参与者静音
Unmute a list of participants in a conference call
POST /conferences/{id}/actions/unmuteOptional: (array[string]), (enum: Australia, Europe, Middle East, US)
call_control_idsregionjavascript
const response = await client.conferences.actions.unmute('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);Returns: (string)
result取消会议中指定参与者的静音状态
POST /conferences/{id}/actions/unmute可选参数:(字符串数组)、(枚举值:Australia, Europe, Middle East, US)
call_control_idsregionjavascript
const response = await client.conferences.actions.unmute('550e8400-e29b-41d4-a716-446655440000');
console.log(response.data);返回值:(字符串)
resultUpdate conference participant
更新会议参与者角色
Update conference participant supervisor_role
POST /conferences/{id}/actions/updatecall_control_idsupervisor_roleOptional: (string), (enum: Australia, Europe, Middle East, US), (array[string])
command_idregionwhisper_call_control_idsjavascript
const action = await client.conferences.actions.update('id', {
call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
supervisor_role: 'whisper',
});
console.log(action.data);Returns: (string)
result更新会议参与者的监督角色
POST /conferences/{id}/actions/updatecall_control_idsupervisor_role可选参数:(字符串)、(枚举值:Australia, Europe, Middle East, US)、(字符串数组)
command_idregionwhisper_call_control_idsjavascript
const action = await client.conferences.actions.update('id', {
call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
supervisor_role: 'whisper',
});
console.log(action.data);返回值:(字符串)
resultRetrieve a conference participant
获取会议参与者详情
Retrieve details of a specific conference participant by their ID or label.
GET /conferences/{id}/participants/{participant_id}javascript
const response = await client.conferences.retrieveParticipant('participant_id', {
id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});
console.log(response.data);Returns: (string), (string), (string), (date-time), (boolean), (string), (string), (boolean), (boolean), (boolean), (enum: joining, joined, left), (date-time), (array[string])
call_control_idcall_leg_idconference_idcreated_atend_conference_on_exitidlabelmutedon_holdsoft_end_conference_on_exitstatusupdated_atwhisper_call_control_ids通过参与者ID或标签获取特定会议参与者的详细信息。
GET /conferences/{id}/participants/{participant_id}javascript
const response = await client.conferences.retrieveParticipant('participant_id', {
id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});
console.log(response.data);返回字段:(字符串)、(字符串)、(字符串)、(日期时间)、(布尔值)、(字符串)、(字符串)、(布尔值)、(布尔值)、(布尔值)、(枚举值:joining, joined, left)、(日期时间)、(字符串数组)
call_control_idcall_leg_idconference_idcreated_atend_conference_on_exitidlabelmutedon_holdsoft_end_conference_on_exitstatusupdated_atwhisper_call_control_idsUpdate a conference participant
更新会议参与者属性
Update properties of a conference participant.
PATCH /conferences/{id}/participants/{participant_id}Optional: (enum: always, never, on_enter, on_exit), (boolean), (boolean)
beep_enabledend_conference_on_exitsoft_end_conference_on_exitjavascript
const response = await client.conferences.updateParticipant('participant_id', {
id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});
console.log(response.data);Returns: (string), (string), (string), (date-time), (boolean), (string), (string), (boolean), (boolean), (boolean), (enum: joining, joined, left), (date-time), (array[string])
call_control_idcall_leg_idconference_idcreated_atend_conference_on_exitidlabelmutedon_holdsoft_end_conference_on_exitstatusupdated_atwhisper_call_control_ids更新会议参与者的属性。
PATCH /conferences/{id}/participants/{participant_id}可选参数:(枚举值:always, never, on_enter, on_exit)、(布尔值)、(布尔值)
beep_enabledend_conference_on_exitsoft_end_conference_on_exitjavascript
const response = await client.conferences.updateParticipant('participant_id', {
id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});
console.log(response.data);返回字段:(字符串)、(字符串)、(字符串)、(日期时间)、(布尔值)、(字符串)、(字符串)、(布尔值)、(布尔值)、(布尔值)、(枚举值:joining, joined, left)、(日期时间)、(字符串数组)
call_control_idcall_leg_idconference_idcreated_atend_conference_on_exitidlabelmutedon_holdsoft_end_conference_on_exitstatusupdated_atwhisper_call_control_idsList queues
列出呼叫队列
List all queues for the authenticated user.
GET /queuesjavascript
// Automatically fetches more pages as needed.
for await (const queue of client.queues.list()) {
console.log(queue.id);
}Returns: (integer), (string), (integer), (string), (integer), (string), (enum: queue), (string)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_at列出已认证用户的所有呼叫队列。
GET /queuesjavascript
// 自动按需获取更多分页内容。
for await (const queue of client.queues.list()) {
console.log(queue.id);
}返回字段:(整数)、(字符串)、(整数)、(字符串)、(整数)、(字符串)、(枚举值:queue)、(字符串)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_atCreate a queue
创建呼叫队列
Create a new call queue.
POST /queuesqueue_nameOptional: (integer)
max_sizejavascript
const queue = await client.queues.create({ queue_name: 'tier_1_support' });
console.log(queue.data);Returns: (integer), (string), (integer), (string), (integer), (string), (enum: queue), (string)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_at创建新的呼叫队列。
POST /queuesqueue_name可选参数:(整数)
max_sizejavascript
const queue = await client.queues.create({ queue_name: 'tier_1_support' });
console.log(queue.data);返回字段:(整数)、(字符串)、(整数)、(字符串)、(整数)、(字符串)、(枚举值:queue)、(字符串)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_atRetrieve a call queue
获取呼叫队列详情
Retrieve an existing call queue
GET /queues/{queue_name}javascript
const queue = await client.queues.retrieve('queue_name');
console.log(queue.data);Returns: (integer), (string), (integer), (string), (integer), (string), (enum: queue), (string)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_at获取现有呼叫队列的详细信息
GET /queues/{queue_name}javascript
const queue = await client.queues.retrieve('queue_name');
console.log(queue.data);返回字段:(整数)、(字符串)、(整数)、(字符串)、(整数)、(字符串)、(枚举值:queue)、(字符串)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_atUpdate a queue
更新呼叫队列
Update properties of an existing call queue.
POST /queues/{queue_name}max_sizejavascript
const queue = await client.queues.update('queue_name', { max_size: 200 });
console.log(queue.data);Returns: (integer), (string), (integer), (string), (integer), (string), (enum: queue), (string)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_at更新现有呼叫队列的属性。
POST /queues/{queue_name}max_sizejavascript
const queue = await client.queues.update('queue_name', { max_size: 200 });
console.log(queue.data);返回字段:(整数)、(字符串)、(整数)、(字符串)、(整数)、(字符串)、(枚举值:queue)、(字符串)
average_wait_time_secscreated_atcurrent_sizeidmax_sizenamerecord_typeupdated_atDelete a queue
删除呼叫队列
Delete an existing call queue.
DELETE /queues/{queue_name}javascript
await client.queues.delete('queue_name');删除现有呼叫队列。
DELETE /queues/{queue_name}javascript
await client.queues.delete('queue_name');Retrieve calls from a queue
获取队列中的呼叫列表
Retrieve the list of calls in an existing queue
GET /queues/{queue_name}/callsjavascript
// Automatically fetches more pages as needed.
for await (const callListResponse of client.queues.calls.list('queue_name')) {
console.log(callListResponse.call_control_id);
}Returns: (string), (string), (string), (string), (string), (string), (boolean), (string), (integer), (enum: queue_call), (string), (integer)
call_control_idcall_leg_idcall_session_idconnection_idenqueued_atfromis_alivequeue_idqueue_positionrecord_typetowait_time_secs获取现有队列中的呼叫列表
GET /queues/{queue_name}/callsjavascript
// 自动按需获取更多分页内容。
for await (const callListResponse of client.queues.calls.list('queue_name')) {
console.log(callListResponse.call_control_id);
}返回字段:(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)、(字符串)、(整数)、(枚举值:queue_call)、(字符串)、(整数)
call_control_idcall_leg_idcall_session_idconnection_idenqueued_atfromis_alivequeue_idqueue_positionrecord_typetowait_time_secsRetrieve a call from a queue
获取队列中的特定呼叫
Retrieve an existing call from an existing queue
GET /queues/{queue_name}/calls/{call_control_id}javascript
const call = await client.queues.calls.retrieve('call_control_id', { queue_name: 'queue_name' });
console.log(call.data);Returns: (string), (string), (string), (string), (string), (string), (boolean), (string), (integer), (enum: queue_call), (string), (integer)
call_control_idcall_leg_idcall_session_idconnection_idenqueued_atfromis_alivequeue_idqueue_positionrecord_typetowait_time_secs从现有队列中获取特定呼叫的详细信息
GET /queues/{queue_name}/calls/{call_control_id}javascript
const call = await client.queues.calls.retrieve('call_control_id', { queue_name: 'queue_name' });
console.log(call.data);返回字段:(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)、(字符串)、(整数)、(枚举值:queue_call)、(字符串)、(整数)
call_control_idcall_leg_idcall_session_idconnection_idenqueued_atfromis_alivequeue_idqueue_positionrecord_typetowait_time_secsUpdate queued call
更新队列中的呼叫
Update queued call's keep_after_hangup flag
PATCH /queues/{queue_name}/calls/{call_control_id}Optional: (boolean)
keep_after_hangupjavascript
await client.queues.calls.update('call_control_id', { queue_name: 'queue_name' });更新队列中呼叫的标记
keep_after_hangupPATCH /queues/{queue_name}/calls/{call_control_id}可选参数:(布尔值)
keep_after_hangupjavascript
await client.queues.calls.update('call_control_id', { queue_name: 'queue_name' });Force remove a call from a queue
强制移除队列中的呼叫
Removes an inactive call from a queue. If the call is no longer active, use this command to remove it from the queue.
DELETE /queues/{queue_name}/calls/{call_control_id}javascript
await client.queues.calls.remove('call_control_id', { queue_name: 'queue_name' });将非活跃呼叫从队列中移除。如果呼叫已不再活跃,使用此命令将其从队列中移除。
DELETE /queues/{queue_name}/calls/{call_control_id}javascript
await client.queues.calls.remove('call_control_id', { queue_name: 'queue_name' });Webhooks
Webhook
Webhook Verification
Webhook验证
Telnyx signs webhooks with Ed25519. Each request includes
and headers. Always verify signatures in production:
telnyx-signature-ed25519telnyx-timestampjavascript
// In your webhook handler (e.g., Express — use raw body, not parsed JSON):
app.post('/webhooks', express.raw({ type: 'application/json' }), async (req, res) => {
try {
const event = await client.webhooks.unwrap(req.body.toString(), {
headers: req.headers,
});
// Signature valid — event is the parsed webhook payload
console.log('Received event:', event.data.event_type);
res.status(200).send('OK');
} catch (err) {
console.error('Webhook verification failed:', err.message);
res.status(400).send('Invalid signature');
}
});The following webhook events are sent to your configured webhook URL.
All webhooks include and headers for Ed25519 signature verification. Use to verify.
telnyx-timestamptelnyx-signature-ed25519client.webhooks.unwrap()| Event | Description |
|---|---|
| Call Enqueued |
| Call Left Queue |
| Conference Created |
| Conference Ended |
| Conference Floor Changed |
| Conference Participant Joined |
| Conference Participant Left |
| Conference Participant Playback Ended |
| Conference Participant Playback Started |
| Conference Participant Speak Ended |
| Conference Participant Speak Started |
| Conference Playback Ended |
| Conference Playback Started |
| Conference Recording Saved |
| Conference Speak Ended |
| Conference Speak Started |
Telnyx使用Ed25519对Webhook进行签名。每个请求都包含和请求头。生产环境中务必验证签名:
telnyx-signature-ed25519telnyx-timestampjavascript
// 在你的Webhook处理程序中(例如Express — 使用原始请求体,而非解析后的JSON):
app.post('/webhooks', express.raw({ type: 'application/json' }), async (req, res) => {
try {
const event = await client.webhooks.unwrap(req.body.toString(), {
headers: req.headers,
});
// 签名有效 — event为解析后的Webhook负载
console.log('Received event:', event.data.event_type);
res.status(200).send('OK');
} catch (err) {
console.error('Webhook verification failed:', err.message);
res.status(400).send('Invalid signature');
}
});以下Webhook事件将发送到你配置的Webhook URL。所有Webhook都包含和请求头用于Ed25519签名验证。使用进行验证。
telnyx-timestamptelnyx-signature-ed25519client.webhooks.unwrap()| 事件 | 描述 |
|---|---|
| 呼叫已加入队列 |
| 呼叫已离开队列 |
| 会议已创建 |
| 会议已结束 |
| 会议发言者已变更 |
| 会议参与者已加入 |
| 会议参与者已离开 |
| 会议参与者音频播放已结束 |
| 会议参与者音频播放已开始 |
| 会议参与者文本转语音播放已结束 |
| 会议参与者文本转语音播放已开始 |
| 会议全局音频播放已结束 |
| 会议全局音频播放已开始 |
| 会议录制已保存 |
| 会议全局文本转语音播放已结束 |
| 会议全局文本转语音播放已开始 |
Webhook payload fields
Webhook负载字段
callEnqueued| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.enqueued | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | The name of the queue |
| integer | Current position of the call in the queue. |
| integer | Average time call spends in the queue in seconds. |
callLeftQueue| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: call.dequeued | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | The name of the queue |
| integer | Last position of the call in the queue. |
| enum: bridged, bridging-in-process, hangup, leave, timeout | The reason for leaving the queue |
| integer | Time call spent in the queue in seconds. |
conferenceCreated| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.created | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Conference ID that the participant joined. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Conference ID that the participant joined. |
| date-time | ISO 8601 datetime of when the event occurred. |
| enum: all_left, host_left, time_exceeded | Reason the conference ended. |
conferenceFloorChanged| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.floor.changed | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call Control ID of the new speaker. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | Call Leg ID of the new speaker. |
| string | Call Session ID of the new speaker. |
| string | State received from a command. |
| string | Conference ID that had a speaker change event. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceParticipantJoined| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.participant.joined | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Conference ID that the participant joined. |
conferenceParticipantLeft| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.participant.left | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| date-time | ISO 8601 datetime of when the event occurred. |
| string | Call ID used to issue commands via Call Control API. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Conference ID that the participant joined. |
conferenceParticipantPlaybackEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.participant.playback.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Participant's call ID used to issue commands via Call Control API. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| string | The audio URL being played back, if audio_url has been used to start. |
| string | The name of the audio media file being played back, if media_name has been used to start. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceParticipantPlaybackStarted| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.participant.playback.started | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Participant's call ID used to issue commands via Call Control API. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| string | The audio URL being played back, if audio_url has been used to start. |
| string | The name of the audio media file being played back, if media_name has been used to start. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceParticipantSpeakEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.participant.speak.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Participant's call ID used to issue commands via Call Control API. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceParticipantSpeakStarted| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.participant.speak.started | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Participant's call ID used to issue commands via Call Control API. |
| string | ID that is unique to the call and can be used to correlate webhook events. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferencePlaybackEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.playback.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| string | The audio URL being played back, if audio_url has been used to start. |
| string | The name of the audio media file being played back, if media_name has been used to start. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferencePlaybackStarted| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.playback.started | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| string | The audio URL being played back, if audio_url has been used to start. |
| string | The name of the audio media file being played back, if media_name has been used to start. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceRecordingSaved| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.recording.saved | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Participant's call ID used to issue commands via Call Control API. |
| string | ID that is unique to the call session and can be used to correlate webhook events. |
| string | State received from a command. |
| enum: single, dual | Whether recording was recorded in |
| uuid | ID of the conference that is being recorded. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| enum: wav, mp3 | The audio file format used when storing the call recording. |
| date-time | ISO 8601 datetime of when recording ended. |
| uuid | ID of the conference recording. |
| date-time | ISO 8601 datetime of when recording started. |
conferenceSpeakEnded| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.speak.ended | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| date-time | ISO 8601 datetime of when the event occurred. |
conferenceSpeakStarted| Field | Type | Description |
|---|---|---|
| enum: event | Identifies the type of the resource. |
| enum: conference.speak.started | The type of event being delivered. |
| uuid | Identifies the type of resource. |
| string | Call Control App ID (formerly Telnyx connection ID) used in the call. |
| string | ID that is unique to the call session that started the conference. |
| string | ID of the conference the text was spoken in. |
| date-time | ISO 8601 datetime of when the event occurred. |
callEnqueued| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:call.enqueued | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
| 字符串 | 用于通过呼叫控制API发起命令的呼叫ID。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 呼叫的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 呼叫会话的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 从命令中接收的状态。 |
| 字符串 | 队列名称 |
| 整数 | 呼叫在队列中的当前位置。 |
| 整数 | 呼叫在队列中的平均等待时间(秒)。 |
callLeftQueue| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:call.dequeued | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
| 字符串 | 用于通过呼叫控制API发起命令的呼叫ID。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 呼叫的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 呼叫会话的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 从命令中接收的状态。 |
| 字符串 | 队列名称 |
| 整数 | 呼叫在队列中的最后位置。 |
| 枚举值:bridged, bridging-in-process, hangup, leave, timeout | 离开队列的原因 |
| 整数 | 呼叫在队列中的等待时间(秒)。 |
conferenceCreated| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.created | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 字符串 | 用于通过呼叫控制API发起命令的呼叫ID。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 呼叫的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 呼叫会话的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 从命令中接收的状态。 |
| 字符串 | 参与者加入的会议ID。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
conferenceEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.ended | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 字符串 | 用于通过呼叫控制API发起命令的呼叫ID。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 呼叫的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 呼叫会话的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 从命令中接收的状态。 |
| 字符串 | 参与者加入的会议ID。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
| 枚举值:all_left, host_left, time_exceeded | 会议结束的原因。 |
conferenceFloorChanged| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.floor.changed | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 字符串 | 新发言者的呼叫控制ID。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 新发言者的呼叫链路ID。 |
| 字符串 | 新发言者的呼叫会话ID。 |
| 字符串 | 从命令中接收的状态。 |
| 字符串 | 发生发言者变更事件的会议ID。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
conferenceParticipantJoined| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.participant.joined | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
| 字符串 | 用于通过呼叫控制API发起命令的呼叫ID。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 呼叫的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 呼叫会话的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 从命令中接收的状态。 |
| 字符串 | 参与者加入的会议ID。 |
conferenceParticipantLeft| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.participant.left | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
| 字符串 | 用于通过呼叫控制API发起命令的呼叫ID。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 呼叫的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 呼叫会话的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 从命令中接收的状态。 |
| 字符串 | 参与者加入的会议ID。 |
conferenceParticipantPlaybackEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.participant.playback.ended | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 字符串 | 参与者用于通过呼叫控制API发起命令的呼叫ID。 |
| 字符串 | 呼叫的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 呼叫会话的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 从命令中接收的状态。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 发起会议的呼叫会话的唯一ID。 |
| 字符串 | 播放音频的会议ID。 |
| 字符串 | 正在播放的音频URL(如果使用audio_url启动播放)。 |
| 字符串 | 正在播放的音频媒体文件名称(如果使用media_name启动播放)。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
conferenceParticipantPlaybackStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.participant.playback.started | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 字符串 | 参与者用于通过呼叫控制API发起命令的呼叫ID。 |
| 字符串 | 呼叫的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 呼叫会话的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 从命令中接收的状态。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 发起会议的呼叫会话的唯一ID。 |
| 字符串 | 播放音频的会议ID。 |
| 字符串 | 正在播放的音频URL(如果使用audio_url启动播放)。 |
| 字符串 | 正在播放的音频媒体文件名称(如果使用media_name启动播放)。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
conferenceParticipantSpeakEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.participant.speak.ended | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 字符串 | 参与者用于通过呼叫控制API发起命令的呼叫ID。 |
| 字符串 | 呼叫的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 呼叫会话的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 从命令中接收的状态。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 发起会议的呼叫会话的唯一ID。 |
| 字符串 | 播放文本转语音的会议ID。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
conferenceParticipantSpeakStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.participant.speak.started | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 字符串 | 参与者用于通过呼叫控制API发起命令的呼叫ID。 |
| 字符串 | 呼叫的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 呼叫会话的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 从命令中接收的状态。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 发起会议的呼叫会话的唯一ID。 |
| 字符串 | 播放文本转语音的会议ID。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
conferencePlaybackEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.playback.ended | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 发起会议的呼叫会话的唯一ID。 |
| 字符串 | 播放音频的会议ID。 |
| 字符串 | 正在播放的音频URL(如果使用audio_url启动播放)。 |
| 字符串 | 正在播放的音频媒体文件名称(如果使用media_name启动播放)。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
conferencePlaybackStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.playback.started | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 发起会议的呼叫会话的唯一ID。 |
| 字符串 | 播放音频的会议ID。 |
| 字符串 | 正在播放的音频URL(如果使用audio_url启动播放)。 |
| 字符串 | 正在播放的音频媒体文件名称(如果使用media_name启动播放)。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
conferenceRecordingSaved| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.recording.saved | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 字符串 | 参与者用于通过呼叫控制API发起命令的呼叫ID。 |
| 字符串 | 呼叫会话的唯一ID,可用于关联Webhook事件。 |
| 字符串 | 从命令中接收的状态。 |
| 枚举值:single, dual | 录制采用单声道还是双声道。 |
| uuid | 正在录制的会议ID。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 枚举值:wav, mp3 | 存储呼叫录制文件时使用的音频格式。 |
| 日期时间 | 录制结束的ISO 8601格式时间。 |
| uuid | 会议录制的ID。 |
| 日期时间 | 录制开始的ISO 8601格式时间。 |
conferenceSpeakEnded| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.speak.ended | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 发起会议的呼叫会话的唯一ID。 |
| 字符串 | 播放文本转语音的会议ID。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |
conferenceSpeakStarted| 字段 | 类型 | 描述 |
|---|---|---|
| 枚举值:event | 标识资源类型。 |
| 枚举值:conference.speak.started | 所传递的事件类型。 |
| uuid | 标识资源类型。 |
| 字符串 | 呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。 |
| 字符串 | 发起会议的呼叫会话的唯一ID。 |
| 字符串 | 播放文本转语音的会议ID。 |
| 日期时间 | 事件发生的ISO 8601格式时间。 |