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 telnyx
bash
npm install telnyx

Setup

初始化设置

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
client
is already initialized as shown above.
javascript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // 这是默认配置,可省略
});
以下所有示例均假设
client
已按照上述方式完成初始化。

Error 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:
401
invalid API key,
403
insufficient permissions,
404
resource not found,
422
validation error (check field formats),
429
rate limited (retry with exponential backoff).
所有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');
    }
  }
}
常见错误码:
401
无效API密钥,
403
权限不足,
404
资源未找到,
422
验证错误(检查字段格式),
429
速率限制(使用指数退避策略重试)。

Important Notes

重要说明

  • Pagination: List methods return an auto-paginating iterator. Use
    for await (const item of result) { ... }
    to iterate through all pages automatically.
  • 分页处理: 列表类方法会返回自动分页的迭代器。使用
    for await (const item of result) { ... }
    可自动遍历所有分页内容。

Enqueue call

将呼叫加入队列

Put the call in a queue.
POST /calls/{call_control_id}/actions/enqueue
— Required:
queue_name
Optional:
client_state
(string),
command_id
(string),
keep_after_hangup
(boolean),
max_size
(integer),
max_wait_time_secs
(integer)
javascript
const response = await client.calls.actions.enqueue('call_control_id', { queue_name: 'support' });

console.log(response.data);
Returns:
result
(string)
将呼叫放入队列。
POST /calls/{call_control_id}/actions/enqueue
— 必填参数:
queue_name
可选参数:
client_state
(字符串)、
command_id
(字符串)、
keep_after_hangup
(布尔值)、
max_size
(整数)、
max_wait_time_secs
(整数)
javascript
const response = await client.calls.actions.enqueue('call_control_id', { queue_name: 'support' });

console.log(response.data);
返回值:
result
(字符串)

Remove call from a queue

将呼叫移出队列

Removes the call from a queue.
POST /calls/{call_control_id}/actions/leave_queue
Optional:
client_state
(string),
command_id
(string)
javascript
const response = await client.calls.actions.leaveQueue('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');

console.log(response.data);
Returns:
result
(string)
将呼叫从队列中移除。
POST /calls/{call_control_id}/actions/leave_queue
可选参数:
client_state
(字符串)、
command_id
(字符串)
javascript
const response = await client.calls.actions.leaveQueue('v3:550e8400-e29b-41d4-a716-446655440000_gRU1OGRkYQ');

console.log(response.data);
返回值:
result
(字符串)

List 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_at
.
GET /conferences
javascript
// Automatically fetches more pages as needed.
for await (const conference of client.conferences.list()) {
  console.log(conference.id);
}
Returns:
connection_id
(string),
created_at
(string),
end_reason
(enum: all_left, ended_via_api, host_left, time_exceeded),
ended_by
(object),
expires_at
(string),
id
(string),
name
(string),
record_type
(enum: conference),
region
(string),
status
(enum: init, in_progress, completed),
updated_at
(string)
列出所有会议。会议会按需创建,当所有参与者离开会议后或无论活跃参与者数量多少,超过4小时后会议将过期。会议按
expires_at
降序排列。
GET /conferences
javascript
// 自动按需获取更多分页内容。
for await (const conference of client.conferences.list()) {
  console.log(conference.id);
}
返回字段:
connection_id
(字符串)、
created_at
(字符串)、
end_reason
(枚举值:all_left, ended_via_api, host_left, time_exceeded)、
ended_by
(对象)、
expires_at
(字符串)、
id
(字符串)、
name
(字符串)、
record_type
(枚举值:conference)、
region
(字符串)、
status
(枚举值:init, in_progress, completed)、
updated_at
(字符串)

Create conference

创建会议

Create a conference from an existing call leg using a
call_control_id
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.
POST /conferences
— Required:
call_control_id
,
name
Optional:
beep_enabled
(enum: always, never, on_enter, on_exit),
client_state
(string),
comfort_noise
(boolean),
command_id
(string),
duration_minutes
(integer),
hold_audio_url
(string),
hold_media_name
(string),
max_participants
(integer),
region
(enum: Australia, Europe, Middle East, US),
start_conference_on_create
(boolean)
javascript
const conference = await client.conferences.create({
  call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
  name: 'Business',
});

console.log(conference.data);
Returns:
connection_id
(string),
created_at
(string),
end_reason
(enum: all_left, ended_via_api, host_left, time_exceeded),
ended_by
(object),
expires_at
(string),
id
(string),
name
(string),
record_type
(enum: conference),
region
(string),
status
(enum: init, in_progress, completed),
updated_at
(string)
使用现有呼叫链路的
call_control_id
和会议名称创建会议。创建会议后,该呼叫将自动接入会议。当所有参与者离开会议后或无论活跃参与者数量多少,超过4小时后会议将过期。
POST /conferences
— 必填参数:
call_control_id
,
name
可选参数:
beep_enabled
(枚举值:always, never, on_enter, on_exit)、
client_state
(字符串)、
comfort_noise
(布尔值)、
command_id
(字符串)、
duration_minutes
(整数)、
hold_audio_url
(字符串)、
hold_media_name
(字符串)、
max_participants
(整数)、
region
(枚举值:Australia, Europe, Middle East, US)、
start_conference_on_create
(布尔值)
javascript
const conference = await client.conferences.create({
  call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
  name: 'Business',
});

console.log(conference.data);
返回字段:
connection_id
(字符串)、
created_at
(字符串)、
end_reason
(枚举值:all_left, ended_via_api, host_left, time_exceeded)、
ended_by
(对象)、
expires_at
(字符串)、
id
(字符串)、
name
(字符串)、
record_type
(枚举值:conference)、
region
(字符串)、
status
(枚举值:init, in_progress, completed)、
updated_at
(字符串)

List conference participants

列出会议参与者

Lists conference participants
GET /conferences/{conference_id}/participants
javascript
// Automatically fetches more pages as needed.
for await (const conferenceListParticipantsResponse of client.conferences.listParticipants(
  'conference_id',
)) {
  console.log(conferenceListParticipantsResponse.id);
}
Returns:
call_control_id
(string),
call_leg_id
(string),
conference
(object),
created_at
(string),
end_conference_on_exit
(boolean),
id
(string),
muted
(boolean),
on_hold
(boolean),
record_type
(enum: participant),
soft_end_conference_on_exit
(boolean),
status
(enum: joining, joined, left),
updated_at
(string),
whisper_call_control_ids
(array[string])
列出会议的所有参与者
GET /conferences/{conference_id}/participants
javascript
// 自动按需获取更多分页内容。
for await (const conferenceListParticipantsResponse of client.conferences.listParticipants(
  'conference_id',
)) {
  console.log(conferenceListParticipantsResponse.id);
}
返回字段:
call_control_id
(字符串)、
call_leg_id
(字符串)、
conference
(对象)、
created_at
(字符串)、
end_conference_on_exit
(布尔值)、
id
(字符串)、
muted
(布尔值)、
on_hold
(布尔值)、
record_type
(枚举值:participant)、
soft_end_conference_on_exit
(布尔值)、
status
(枚举值:joining, joined, left)、
updated_at
(字符串)、
whisper_call_control_ids
(字符串数组)

Retrieve 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:
connection_id
(string),
created_at
(string),
end_reason
(enum: all_left, ended_via_api, host_left, time_exceeded),
ended_by
(object),
expires_at
(string),
id
(string),
name
(string),
record_type
(enum: conference),
region
(string),
status
(enum: init, in_progress, completed),
updated_at
(string)
获取现有会议的详细信息
GET /conferences/{id}
javascript
const conference = await client.conferences.retrieve('550e8400-e29b-41d4-a716-446655440000');

console.log(conference.data);
返回字段:
connection_id
(字符串)、
created_at
(字符串)、
end_reason
(枚举值:all_left, ended_via_api, host_left, time_exceeded)、
ended_by
(对象)、
expires_at
(字符串)、
id
(字符串)、
name
(字符串)、
record_type
(枚举值:conference)、
region
(字符串)、
status
(枚举值:init, in_progress, completed)、
updated_at
(字符串)

End a conference

结束会议

End a conference and terminate all active participants.
POST /conferences/{id}/actions/end
Optional:
command_id
(string)
javascript
const response = await client.conferences.actions.endConference(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);

console.log(response.data);
Returns:
result
(string)
结束会议并终止所有活跃参与者的呼叫。
POST /conferences/{id}/actions/end
可选参数:
command_id
(字符串)
javascript
const response = await client.conferences.actions.endConference(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);

console.log(response.data);
返回值:
result
(字符串)

Gather 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_audio
— Required:
call_control_id
Optional:
audio_url
(string),
client_state
(string),
gather_id
(string),
initial_timeout_millis
(integer),
inter_digit_timeout_millis
(integer),
invalid_audio_url
(string),
invalid_media_name
(string),
maximum_digits
(integer),
maximum_tries
(integer),
media_name
(string),
minimum_digits
(integer),
stop_playback_on_dtmf
(boolean),
terminating_digit
(string),
timeout_millis
(integer),
valid_digits
(string)
javascript
const response = await client.conferences.actions.gatherDtmfAudio(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  { call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg' },
);

console.log(response.data);
Returns:
result
(string)
向特定会议参与者播放音频文件并收集DTMF输入。
POST /conferences/{id}/actions/gather_using_audio
— 必填参数:
call_control_id
可选参数:
audio_url
(字符串)、
client_state
(字符串)、
gather_id
(字符串)、
initial_timeout_millis
(整数)、
inter_digit_timeout_millis
(整数)、
invalid_audio_url
(字符串)、
invalid_media_name
(字符串)、
maximum_digits
(整数)、
maximum_tries
(整数)、
media_name
(字符串)、
minimum_digits
(整数)、
stop_playback_on_dtmf
(布尔值)、
terminating_digit
(字符串)、
timeout_millis
(整数)、
valid_digits
(字符串)
javascript
const response = await client.conferences.actions.gatherDtmfAudio(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  { call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg' },
);

console.log(response.data);
返回值:
result
(字符串)

Hold conference participants

置休会议参与者

Hold a list of participants in a conference call
POST /conferences/{id}/actions/hold
Optional:
audio_url
(string),
call_control_ids
(array[string]),
media_name
(string),
region
(enum: Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.hold('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
Returns:
result
(string)
将会议中的指定参与者置休
POST /conferences/{id}/actions/hold
可选参数:
audio_url
(字符串)、
call_control_ids
(字符串数组)、
media_name
(字符串)、
region
(枚举值:Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.hold('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
返回值:
result
(字符串)

Join a conference

加入会议

Join an existing call leg to a conference. Issue the Join Conference command with the conference ID in the path and the
call_control_id
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
max_participants
parameter in conference creation request.
POST /conferences/{id}/actions/join
— Required:
call_control_id
Optional:
beep_enabled
(enum: always, never, on_enter, on_exit),
client_state
(string),
command_id
(string),
end_conference_on_exit
(boolean),
hold
(boolean),
hold_audio_url
(string),
hold_media_name
(string),
mute
(boolean),
region
(enum: Australia, Europe, Middle East, US),
soft_end_conference_on_exit
(boolean),
start_conference_on_enter
(boolean),
supervisor_role
(enum: barge, monitor, none, whisper),
whisper_call_control_ids
(array[string])
javascript
const response = await client.conferences.actions.join('id', {
  call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
});

console.log(response.data);
Returns:
result
(string)
将现有呼叫链路接入会议。使用路径中的会议ID和要接入会议的呼叫链路的
call_control_id
作为属性发起加入会议命令。会议的最大活跃参与者数量由创建会议请求中的
max_participants
参数设置。
POST /conferences/{id}/actions/join
— 必填参数:
call_control_id
可选参数:
beep_enabled
(枚举值:always, never, on_enter, on_exit)、
client_state
(字符串)、
command_id
(字符串)、
end_conference_on_exit
(布尔值)、
hold
(布尔值)、
hold_audio_url
(字符串)、
hold_media_name
(字符串)、
mute
(布尔值)、
region
(枚举值:Australia, Europe, Middle East, US)、
soft_end_conference_on_exit
(布尔值)、
start_conference_on_enter
(布尔值)、
supervisor_role
(枚举值:barge, monitor, none, whisper)、
whisper_call_control_ids
(字符串数组)
javascript
const response = await client.conferences.actions.join('id', {
  call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
});

console.log(response.data);
返回值:
result
(字符串)

Leave 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/leave
— Required:
call_control_id
Optional:
beep_enabled
(enum: always, never, on_enter, on_exit),
command_id
(string),
region
(enum: Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.leave('id', {
  call_control_id: 'c46e06d7-b78f-4b13-96b6-c576af9640ff',
});

console.log(response.data);
Returns:
result
(string)
将呼叫链路从会议中移除并移至驻留状态。预期Webhook事件:
  • conference.participant.left
POST /conferences/{id}/actions/leave
— 必填参数:
call_control_id
可选参数:
beep_enabled
(枚举值:always, never, on_enter, on_exit)、
command_id
(字符串)、
region
(枚举值:Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.leave('id', {
  call_control_id: 'c46e06d7-b78f-4b13-96b6-c576af9640ff',
});

console.log(response.data);
返回值:
result
(字符串)

Mute conference participants

静音会议参与者

Mute a list of participants in a conference call
POST /conferences/{id}/actions/mute
Optional:
call_control_ids
(array[string]),
region
(enum: Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.mute('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
Returns:
result
(string)
将会议中的指定参与者静音
POST /conferences/{id}/actions/mute
可选参数:
call_control_ids
(字符串数组)、
region
(枚举值:Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.mute('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
返回值:
result
(字符串)

Play audio to conference participants

向会议参与者播放音频

Play audio to all or some participants on a conference call.
POST /conferences/{id}/actions/play
Optional:
audio_url
(string),
call_control_ids
(array[string]),
loop
(string),
media_name
(string),
region
(enum: Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.play('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
Returns:
result
(string)
向会议中的全部或部分参与者播放音频。
POST /conferences/{id}/actions/play
可选参数:
audio_url
(字符串)、
call_control_ids
(字符串数组)、
loop
(字符串)、
media_name
(字符串)、
region
(枚举值:Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.play('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
返回值:
result
(字符串)

Conference recording pause

暂停会议录制

Pause conference recording.
POST /conferences/{id}/actions/record_pause
Optional:
command_id
(string),
recording_id
(string),
region
(enum: Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.recordPause('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
Returns:
result
(string)
暂停会议录制。
POST /conferences/{id}/actions/record_pause
可选参数:
command_id
(字符串)、
recording_id
(字符串)、
region
(枚举值:Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.recordPause('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
返回值:
result
(字符串)

Conference recording resume

恢复会议录制

Resume conference recording.
POST /conferences/{id}/actions/record_resume
Optional:
command_id
(string),
recording_id
(string),
region
(enum: Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.recordResume('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
Returns:
result
(string)
恢复会议录制。
POST /conferences/{id}/actions/record_resume
可选参数:
command_id
(字符串)、
recording_id
(字符串)、
region
(枚举值:Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.recordResume('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
返回值:
result
(字符串)

Conference 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_start
— Required:
format
Optional:
channels
(enum: single, dual),
command_id
(string),
custom_file_name
(string),
play_beep
(boolean),
region
(enum: Australia, Europe, Middle East, US),
trim
(enum: trim-silence)
javascript
const response = await client.conferences.actions.recordStart('id', { format: 'wav' });

console.log(response.data);
Returns:
result
(string)
开始录制会议。录制将在会议结束时或通过停止录制命令停止。预期Webhook事件:
  • conference.recording.saved
POST /conferences/{id}/actions/record_start
— 必填参数:
format
可选参数:
channels
(枚举值:single, dual)、
command_id
(字符串)、
custom_file_name
(字符串)、
play_beep
(布尔值)、
region
(枚举值:Australia, Europe, Middle East, US)、
trim
(枚举值:trim-silence)
javascript
const response = await client.conferences.actions.recordStart('id', { format: 'wav' });

console.log(response.data);
返回值:
result
(字符串)

Conference recording stop

停止会议录制

Stop recording the conference. Expected Webhooks:
  • conference.recording.saved
POST /conferences/{id}/actions/record_stop
Optional:
client_state
(string),
command_id
(string),
recording_id
(uuid),
region
(enum: Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.recordStop('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
Returns:
result
(string)
停止录制会议。预期Webhook事件:
  • conference.recording.saved
POST /conferences/{id}/actions/record_stop
可选参数:
client_state
(字符串)、
command_id
(字符串)、
recording_id
(uuid)、
region
(枚举值:Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.recordStop('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
返回值:
result
(字符串)

Send DTMF to conference participants

向会议参与者发送DTMF信号

Send DTMF tones to one or more conference participants.
POST /conferences/{id}/actions/send_dtmf
— Required:
digits
Optional:
call_control_ids
(array[string]),
client_state
(string),
duration_millis
(integer)
javascript
const response = await client.conferences.actions.sendDtmf('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
  digits: '1234#',
});

console.log(response.data);
Returns:
result
(string)
向一个或多个会议参与者发送DTMF信号。
POST /conferences/{id}/actions/send_dtmf
— 必填参数:
digits
可选参数:
call_control_ids
(字符串数组)、
client_state
(字符串)、
duration_millis
(整数)
javascript
const response = await client.conferences.actions.sendDtmf('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
  digits: '1234#',
});

console.log(response.data);
返回值:
result
(字符串)

Speak text to conference participants

向会议参与者播放文本转语音内容

Convert text to speech and play it to all or some participants.
POST /conferences/{id}/actions/speak
— Required:
payload
,
voice
Optional:
call_control_ids
(array[string]),
command_id
(string),
language
(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),
payload_type
(enum: text, ssml),
region
(enum: Australia, Europe, Middle East, US),
voice_settings
(object)
javascript
const response = await client.conferences.actions.speak('id', {
  payload: 'Say this to participants',
  voice: 'female',
});

console.log(response.data);
Returns:
result
(string)
将文本转换为语音并播放给全部或部分参与者。
POST /conferences/{id}/actions/speak
— 必填参数:
payload
,
voice
可选参数:
call_control_ids
(字符串数组)、
command_id
(字符串)、
language
(枚举值: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)、
payload_type
(枚举值:text, ssml)、
region
(枚举值:Australia, Europe, Middle East, US)、
voice_settings
(对象)
javascript
const response = await client.conferences.actions.speak('id', {
  payload: 'Say this to participants',
  voice: 'female',
});

console.log(response.data);
返回值:
result
(字符串)

Stop audio being played on the conference

停止会议中的音频播放

Stop audio being played to all or some participants on a conference call.
POST /conferences/{id}/actions/stop
Optional:
call_control_ids
(array[string]),
region
(enum: Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.stop('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
Returns:
result
(string)
停止向会议中的全部或部分参与者播放音频。
POST /conferences/{id}/actions/stop
可选参数:
call_control_ids
(字符串数组)、
region
(枚举值:Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.stop('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
返回值:
result
(字符串)

Unhold conference participants

取消参与者置休

Unhold a list of participants in a conference call
POST /conferences/{id}/actions/unhold
— Required:
call_control_ids
Optional:
region
(enum: Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.unhold('id', {
  call_control_ids: ['v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg'],
});

console.log(response.data);
Returns:
result
(string)
取消会议中指定参与者的置休状态
POST /conferences/{id}/actions/unhold
— 必填参数:
call_control_ids
可选参数:
region
(枚举值:Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.unhold('id', {
  call_control_ids: ['v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg'],
});

console.log(response.data);
返回值:
result
(字符串)

Unmute conference participants

取消参与者静音

Unmute a list of participants in a conference call
POST /conferences/{id}/actions/unmute
Optional:
call_control_ids
(array[string]),
region
(enum: Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.unmute('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
Returns:
result
(string)
取消会议中指定参与者的静音状态
POST /conferences/{id}/actions/unmute
可选参数:
call_control_ids
(字符串数组)、
region
(枚举值:Australia, Europe, Middle East, US)
javascript
const response = await client.conferences.actions.unmute('550e8400-e29b-41d4-a716-446655440000');

console.log(response.data);
返回值:
result
(字符串)

Update conference participant

更新会议参与者角色

Update conference participant supervisor_role
POST /conferences/{id}/actions/update
— Required:
call_control_id
,
supervisor_role
Optional:
command_id
(string),
region
(enum: Australia, Europe, Middle East, US),
whisper_call_control_ids
(array[string])
javascript
const action = await client.conferences.actions.update('id', {
  call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
  supervisor_role: 'whisper',
});

console.log(action.data);
Returns:
result
(string)
更新会议参与者的监督角色
POST /conferences/{id}/actions/update
— 必填参数:
call_control_id
,
supervisor_role
可选参数:
command_id
(字符串)、
region
(枚举值:Australia, Europe, Middle East, US)、
whisper_call_control_ids
(字符串数组)
javascript
const action = await client.conferences.actions.update('id', {
  call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
  supervisor_role: 'whisper',
});

console.log(action.data);
返回值:
result
(字符串)

Retrieve 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:
call_control_id
(string),
call_leg_id
(string),
conference_id
(string),
created_at
(date-time),
end_conference_on_exit
(boolean),
id
(string),
label
(string),
muted
(boolean),
on_hold
(boolean),
soft_end_conference_on_exit
(boolean),
status
(enum: joining, joined, left),
updated_at
(date-time),
whisper_call_control_ids
(array[string])
通过参与者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);
返回字段:
call_control_id
(字符串)、
call_leg_id
(字符串)、
conference_id
(字符串)、
created_at
(日期时间)、
end_conference_on_exit
(布尔值)、
id
(字符串)、
label
(字符串)、
muted
(布尔值)、
on_hold
(布尔值)、
soft_end_conference_on_exit
(布尔值)、
status
(枚举值:joining, joined, left)、
updated_at
(日期时间)、
whisper_call_control_ids
(字符串数组)

Update a conference participant

更新会议参与者属性

Update properties of a conference participant.
PATCH /conferences/{id}/participants/{participant_id}
Optional:
beep_enabled
(enum: always, never, on_enter, on_exit),
end_conference_on_exit
(boolean),
soft_end_conference_on_exit
(boolean)
javascript
const response = await client.conferences.updateParticipant('participant_id', {
  id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});

console.log(response.data);
Returns:
call_control_id
(string),
call_leg_id
(string),
conference_id
(string),
created_at
(date-time),
end_conference_on_exit
(boolean),
id
(string),
label
(string),
muted
(boolean),
on_hold
(boolean),
soft_end_conference_on_exit
(boolean),
status
(enum: joining, joined, left),
updated_at
(date-time),
whisper_call_control_ids
(array[string])
更新会议参与者的属性。
PATCH /conferences/{id}/participants/{participant_id}
可选参数:
beep_enabled
(枚举值:always, never, on_enter, on_exit)、
end_conference_on_exit
(布尔值)、
soft_end_conference_on_exit
(布尔值)
javascript
const response = await client.conferences.updateParticipant('participant_id', {
  id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});

console.log(response.data);
返回字段:
call_control_id
(字符串)、
call_leg_id
(字符串)、
conference_id
(字符串)、
created_at
(日期时间)、
end_conference_on_exit
(布尔值)、
id
(字符串)、
label
(字符串)、
muted
(布尔值)、
on_hold
(布尔值)、
soft_end_conference_on_exit
(布尔值)、
status
(枚举值:joining, joined, left)、
updated_at
(日期时间)、
whisper_call_control_ids
(字符串数组)

List queues

列出呼叫队列

List all queues for the authenticated user.
GET /queues
javascript
// Automatically fetches more pages as needed.
for await (const queue of client.queues.list()) {
  console.log(queue.id);
}
Returns:
average_wait_time_secs
(integer),
created_at
(string),
current_size
(integer),
id
(string),
max_size
(integer),
name
(string),
record_type
(enum: queue),
updated_at
(string)
列出已认证用户的所有呼叫队列。
GET /queues
javascript
// 自动按需获取更多分页内容。
for await (const queue of client.queues.list()) {
  console.log(queue.id);
}
返回字段:
average_wait_time_secs
(整数)、
created_at
(字符串)、
current_size
(整数)、
id
(字符串)、
max_size
(整数)、
name
(字符串)、
record_type
(枚举值:queue)、
updated_at
(字符串)

Create a queue

创建呼叫队列

Create a new call queue.
POST /queues
— Required:
queue_name
Optional:
max_size
(integer)
javascript
const queue = await client.queues.create({ queue_name: 'tier_1_support' });

console.log(queue.data);
Returns:
average_wait_time_secs
(integer),
created_at
(string),
current_size
(integer),
id
(string),
max_size
(integer),
name
(string),
record_type
(enum: queue),
updated_at
(string)
创建新的呼叫队列。
POST /queues
— 必填参数:
queue_name
可选参数:
max_size
(整数)
javascript
const queue = await client.queues.create({ queue_name: 'tier_1_support' });

console.log(queue.data);
返回字段:
average_wait_time_secs
(整数)、
created_at
(字符串)、
current_size
(整数)、
id
(字符串)、
max_size
(整数)、
name
(字符串)、
record_type
(枚举值:queue)、
updated_at
(字符串)

Retrieve 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:
average_wait_time_secs
(integer),
created_at
(string),
current_size
(integer),
id
(string),
max_size
(integer),
name
(string),
record_type
(enum: queue),
updated_at
(string)
获取现有呼叫队列的详细信息
GET /queues/{queue_name}
javascript
const queue = await client.queues.retrieve('queue_name');

console.log(queue.data);
返回字段:
average_wait_time_secs
(整数)、
created_at
(字符串)、
current_size
(整数)、
id
(字符串)、
max_size
(整数)、
name
(字符串)、
record_type
(枚举值:queue)、
updated_at
(字符串)

Update a queue

更新呼叫队列

Update properties of an existing call queue.
POST /queues/{queue_name}
— Required:
max_size
javascript
const queue = await client.queues.update('queue_name', { max_size: 200 });

console.log(queue.data);
Returns:
average_wait_time_secs
(integer),
created_at
(string),
current_size
(integer),
id
(string),
max_size
(integer),
name
(string),
record_type
(enum: queue),
updated_at
(string)
更新现有呼叫队列的属性。
POST /queues/{queue_name}
— 必填参数:
max_size
javascript
const queue = await client.queues.update('queue_name', { max_size: 200 });

console.log(queue.data);
返回字段:
average_wait_time_secs
(整数)、
created_at
(字符串)、
current_size
(整数)、
id
(字符串)、
max_size
(整数)、
name
(字符串)、
record_type
(枚举值:queue)、
updated_at
(字符串)

Delete 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}/calls
javascript
// Automatically fetches more pages as needed.
for await (const callListResponse of client.queues.calls.list('queue_name')) {
  console.log(callListResponse.call_control_id);
}
Returns:
call_control_id
(string),
call_leg_id
(string),
call_session_id
(string),
connection_id
(string),
enqueued_at
(string),
from
(string),
is_alive
(boolean),
queue_id
(string),
queue_position
(integer),
record_type
(enum: queue_call),
to
(string),
wait_time_secs
(integer)
获取现有队列中的呼叫列表
GET /queues/{queue_name}/calls
javascript
// 自动按需获取更多分页内容。
for await (const callListResponse of client.queues.calls.list('queue_name')) {
  console.log(callListResponse.call_control_id);
}
返回字段:
call_control_id
(字符串)、
call_leg_id
(字符串)、
call_session_id
(字符串)、
connection_id
(字符串)、
enqueued_at
(字符串)、
from
(字符串)、
is_alive
(布尔值)、
queue_id
(字符串)、
queue_position
(整数)、
record_type
(枚举值:queue_call)、
to
(字符串)、
wait_time_secs
(整数)

Retrieve 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:
call_control_id
(string),
call_leg_id
(string),
call_session_id
(string),
connection_id
(string),
enqueued_at
(string),
from
(string),
is_alive
(boolean),
queue_id
(string),
queue_position
(integer),
record_type
(enum: queue_call),
to
(string),
wait_time_secs
(integer)
从现有队列中获取特定呼叫的详细信息
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);
返回字段:
call_control_id
(字符串)、
call_leg_id
(字符串)、
call_session_id
(字符串)、
connection_id
(字符串)、
enqueued_at
(字符串)、
from
(字符串)、
is_alive
(布尔值)、
queue_id
(字符串)、
queue_position
(整数)、
record_type
(枚举值:queue_call)、
to
(字符串)、
wait_time_secs
(整数)

Update queued call

更新队列中的呼叫

Update queued call's keep_after_hangup flag
PATCH /queues/{queue_name}/calls/{call_control_id}
Optional:
keep_after_hangup
(boolean)
javascript
await client.queues.calls.update('call_control_id', { queue_name: 'queue_name' });
更新队列中呼叫的
keep_after_hangup
标记
PATCH /queues/{queue_name}/calls/{call_control_id}
可选参数:
keep_after_hangup
(布尔值)
javascript
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
telnyx-signature-ed25519
and
telnyx-timestamp
headers. Always verify signatures in production:
javascript
// 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
telnyx-timestamp
and
telnyx-signature-ed25519
headers for Ed25519 signature verification. Use
client.webhooks.unwrap()
to verify.
EventDescription
callEnqueued
Call Enqueued
callLeftQueue
Call Left Queue
conferenceCreated
Conference Created
conferenceEnded
Conference Ended
conferenceFloorChanged
Conference Floor Changed
conferenceParticipantJoined
Conference Participant Joined
conferenceParticipantLeft
Conference Participant Left
conferenceParticipantPlaybackEnded
Conference Participant Playback Ended
conferenceParticipantPlaybackStarted
Conference Participant Playback Started
conferenceParticipantSpeakEnded
Conference Participant Speak Ended
conferenceParticipantSpeakStarted
Conference Participant Speak Started
conferencePlaybackEnded
Conference Playback Ended
conferencePlaybackStarted
Conference Playback Started
conferenceRecordingSaved
Conference Recording Saved
conferenceSpeakEnded
Conference Speak Ended
conferenceSpeakStarted
Conference Speak Started
Telnyx使用Ed25519对Webhook进行签名。每个请求都包含
telnyx-signature-ed25519
telnyx-timestamp
请求头。生产环境中务必验证签名:
javascript
// 在你的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都包含
telnyx-timestamp
telnyx-signature-ed25519
请求头用于Ed25519签名验证。使用
client.webhooks.unwrap()
进行验证。
事件描述
callEnqueued
呼叫已加入队列
callLeftQueue
呼叫已离开队列
conferenceCreated
会议已创建
conferenceEnded
会议已结束
conferenceFloorChanged
会议发言者已变更
conferenceParticipantJoined
会议参与者已加入
conferenceParticipantLeft
会议参与者已离开
conferenceParticipantPlaybackEnded
会议参与者音频播放已结束
conferenceParticipantPlaybackStarted
会议参与者音频播放已开始
conferenceParticipantSpeakEnded
会议参与者文本转语音播放已结束
conferenceParticipantSpeakStarted
会议参与者文本转语音播放已开始
conferencePlaybackEnded
会议全局音频播放已结束
conferencePlaybackStarted
会议全局音频播放已开始
conferenceRecordingSaved
会议录制已保存
conferenceSpeakEnded
会议全局文本转语音播放已结束
conferenceSpeakStarted
会议全局文本转语音播放已开始

Webhook payload fields

Webhook负载字段

callEnqueued
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.enqueuedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.queue
stringThe name of the queue
data.payload.current_position
integerCurrent position of the call in the queue.
data.payload.queue_avg_wait_time_secs
integerAverage time call spends in the queue in seconds.
callLeftQueue
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: call.dequeuedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.queue
stringThe name of the queue
data.payload.queue_position
integerLast position of the call in the queue.
data.payload.reason
enum: bridged, bridging-in-process, hangup, leave, timeoutThe reason for leaving the queue
data.payload.wait_time_secs
integerTime call spent in the queue in seconds.
conferenceCreated
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.createdThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.conference_id
stringConference ID that the participant joined.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.endedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.conference_id
stringConference ID that the participant joined.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.reason
enum: all_left, host_left, time_exceededReason the conference ended.
conferenceFloorChanged
FieldTypeDescription
record_type
enum: eventIdentifies the type of the resource.
event_type
enum: conference.floor.changedThe type of event being delivered.
id
uuidIdentifies the type of resource.
payload.call_control_id
stringCall Control ID of the new speaker.
payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
payload.call_leg_id
stringCall Leg ID of the new speaker.
payload.call_session_id
stringCall Session ID of the new speaker.
payload.client_state
stringState received from a command.
payload.conference_id
stringConference ID that had a speaker change event.
payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceParticipantJoined
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.participant.joinedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.conference_id
stringConference ID that the participant joined.
conferenceParticipantLeft
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.participant.leftThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.occurred_at
date-timeISO 8601 datetime of when the event occurred.
data.payload.call_control_id
stringCall ID used to issue commands via Call Control API.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.conference_id
stringConference ID that the participant joined.
conferenceParticipantPlaybackEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.participant.playback.endedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringParticipant's call ID used to issue commands via Call Control API.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.media_url
stringThe audio URL being played back, if audio_url has been used to start.
data.payload.media_name
stringThe name of the audio media file being played back, if media_name has been used to start.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceParticipantPlaybackStarted
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.participant.playback.startedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringParticipant's call ID used to issue commands via Call Control API.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.media_url
stringThe audio URL being played back, if audio_url has been used to start.
data.payload.media_name
stringThe name of the audio media file being played back, if media_name has been used to start.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceParticipantSpeakEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.participant.speak.endedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringParticipant's call ID used to issue commands via Call Control API.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceParticipantSpeakStarted
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.participant.speak.startedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringParticipant's call ID used to issue commands via Call Control API.
data.payload.call_leg_id
stringID that is unique to the call and can be used to correlate webhook events.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferencePlaybackEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.playback.endedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.media_url
stringThe audio URL being played back, if audio_url has been used to start.
data.payload.media_name
stringThe name of the audio media file being played back, if media_name has been used to start.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferencePlaybackStarted
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.playback.startedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.media_url
stringThe audio URL being played back, if audio_url has been used to start.
data.payload.media_name
stringThe name of the audio media file being played back, if media_name has been used to start.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceRecordingSaved
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.recording.savedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.call_control_id
stringParticipant's call ID used to issue commands via Call Control API.
data.payload.call_session_id
stringID that is unique to the call session and can be used to correlate webhook events.
data.payload.client_state
stringState received from a command.
data.payload.channels
enum: single, dualWhether recording was recorded in
single
or
dual
channel.
data.payload.conference_id
uuidID of the conference that is being recorded.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.format
enum: wav, mp3The audio file format used when storing the call recording.
data.payload.recording_ended_at
date-timeISO 8601 datetime of when recording ended.
data.payload.recording_id
uuidID of the conference recording.
data.payload.recording_started_at
date-timeISO 8601 datetime of when recording started.
conferenceSpeakEnded
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.speak.endedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
conferenceSpeakStarted
FieldTypeDescription
data.record_type
enum: eventIdentifies the type of the resource.
data.event_type
enum: conference.speak.startedThe type of event being delivered.
data.id
uuidIdentifies the type of resource.
data.payload.connection_id
stringCall Control App ID (formerly Telnyx connection ID) used in the call.
data.payload.creator_call_session_id
stringID that is unique to the call session that started the conference.
data.payload.conference_id
stringID of the conference the text was spoken in.
data.payload.occurred_at
date-timeISO 8601 datetime of when the event occurred.
callEnqueued
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:call.enqueued所传递的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API发起命令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.queue
字符串队列名称
data.payload.current_position
整数呼叫在队列中的当前位置。
data.payload.queue_avg_wait_time_secs
整数呼叫在队列中的平均等待时间(秒)。
callLeftQueue
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:call.dequeued所传递的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API发起命令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.queue
字符串队列名称
data.payload.queue_position
整数呼叫在队列中的最后位置。
data.payload.reason
枚举值:bridged, bridging-in-process, hangup, leave, timeout离开队列的原因
data.payload.wait_time_secs
整数呼叫在队列中的等待时间(秒)。
conferenceCreated
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.created所传递的事件类型。
data.id
uuid标识资源类型。
data.payload.call_control_id
字符串用于通过呼叫控制API发起命令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.conference_id
字符串参与者加入的会议ID。
data.payload.occurred_at
日期时间事件发生的ISO 8601格式时间。
conferenceEnded
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.ended所传递的事件类型。
data.id
uuid标识资源类型。
data.payload.call_control_id
字符串用于通过呼叫控制API发起命令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.conference_id
字符串参与者加入的会议ID。
data.payload.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.reason
枚举值:all_left, host_left, time_exceeded会议结束的原因。
conferenceFloorChanged
字段类型描述
record_type
枚举值:event标识资源类型。
event_type
枚举值:conference.floor.changed所传递的事件类型。
id
uuid标识资源类型。
payload.call_control_id
字符串新发言者的呼叫控制ID。
payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
payload.call_leg_id
字符串新发言者的呼叫链路ID。
payload.call_session_id
字符串新发言者的呼叫会话ID。
payload.client_state
字符串从命令中接收的状态。
payload.conference_id
字符串发生发言者变更事件的会议ID。
payload.occurred_at
日期时间事件发生的ISO 8601格式时间。
conferenceParticipantJoined
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.participant.joined所传递的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API发起命令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.conference_id
字符串参与者加入的会议ID。
conferenceParticipantLeft
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.participant.left所传递的事件类型。
data.id
uuid标识资源类型。
data.occurred_at
日期时间事件发生的ISO 8601格式时间。
data.payload.call_control_id
字符串用于通过呼叫控制API发起命令的呼叫ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.conference_id
字符串参与者加入的会议ID。
conferenceParticipantPlaybackEnded
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.participant.playback.ended所传递的事件类型。
data.id
uuid标识资源类型。
data.payload.call_control_id
字符串参与者用于通过呼叫控制API发起命令的呼叫ID。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.creator_call_session_id
字符串发起会议的呼叫会话的唯一ID。
data.payload.conference_id
字符串播放音频的会议ID。
data.payload.media_url
字符串正在播放的音频URL(如果使用audio_url启动播放)。
data.payload.media_name
字符串正在播放的音频媒体文件名称(如果使用media_name启动播放)。
data.payload.occurred_at
日期时间事件发生的ISO 8601格式时间。
conferenceParticipantPlaybackStarted
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.participant.playback.started所传递的事件类型。
data.id
uuid标识资源类型。
data.payload.call_control_id
字符串参与者用于通过呼叫控制API发起命令的呼叫ID。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.creator_call_session_id
字符串发起会议的呼叫会话的唯一ID。
data.payload.conference_id
字符串播放音频的会议ID。
data.payload.media_url
字符串正在播放的音频URL(如果使用audio_url启动播放)。
data.payload.media_name
字符串正在播放的音频媒体文件名称(如果使用media_name启动播放)。
data.payload.occurred_at
日期时间事件发生的ISO 8601格式时间。
conferenceParticipantSpeakEnded
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.participant.speak.ended所传递的事件类型。
data.id
uuid标识资源类型。
data.payload.call_control_id
字符串参与者用于通过呼叫控制API发起命令的呼叫ID。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.creator_call_session_id
字符串发起会议的呼叫会话的唯一ID。
data.payload.conference_id
字符串播放文本转语音的会议ID。
data.payload.occurred_at
日期时间事件发生的ISO 8601格式时间。
conferenceParticipantSpeakStarted
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.participant.speak.started所传递的事件类型。
data.id
uuid标识资源类型。
data.payload.call_control_id
字符串参与者用于通过呼叫控制API发起命令的呼叫ID。
data.payload.call_leg_id
字符串呼叫的唯一ID,可用于关联Webhook事件。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.creator_call_session_id
字符串发起会议的呼叫会话的唯一ID。
data.payload.conference_id
字符串播放文本转语音的会议ID。
data.payload.occurred_at
日期时间事件发生的ISO 8601格式时间。
conferencePlaybackEnded
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.playback.ended所传递的事件类型。
data.id
uuid标识资源类型。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.creator_call_session_id
字符串发起会议的呼叫会话的唯一ID。
data.payload.conference_id
字符串播放音频的会议ID。
data.payload.media_url
字符串正在播放的音频URL(如果使用audio_url启动播放)。
data.payload.media_name
字符串正在播放的音频媒体文件名称(如果使用media_name启动播放)。
data.payload.occurred_at
日期时间事件发生的ISO 8601格式时间。
conferencePlaybackStarted
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.playback.started所传递的事件类型。
data.id
uuid标识资源类型。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.creator_call_session_id
字符串发起会议的呼叫会话的唯一ID。
data.payload.conference_id
字符串播放音频的会议ID。
data.payload.media_url
字符串正在播放的音频URL(如果使用audio_url启动播放)。
data.payload.media_name
字符串正在播放的音频媒体文件名称(如果使用media_name启动播放)。
data.payload.occurred_at
日期时间事件发生的ISO 8601格式时间。
conferenceRecordingSaved
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.recording.saved所传递的事件类型。
data.id
uuid标识资源类型。
data.payload.call_control_id
字符串参与者用于通过呼叫控制API发起命令的呼叫ID。
data.payload.call_session_id
字符串呼叫会话的唯一ID,可用于关联Webhook事件。
data.payload.client_state
字符串从命令中接收的状态。
data.payload.channels
枚举值:single, dual录制采用单声道还是双声道。
data.payload.conference_id
uuid正在录制的会议ID。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.format
枚举值:wav, mp3存储呼叫录制文件时使用的音频格式。
data.payload.recording_ended_at
日期时间录制结束的ISO 8601格式时间。
data.payload.recording_id
uuid会议录制的ID。
data.payload.recording_started_at
日期时间录制开始的ISO 8601格式时间。
conferenceSpeakEnded
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.speak.ended所传递的事件类型。
data.id
uuid标识资源类型。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.creator_call_session_id
字符串发起会议的呼叫会话的唯一ID。
data.payload.conference_id
字符串播放文本转语音的会议ID。
data.payload.occurred_at
日期时间事件发生的ISO 8601格式时间。
conferenceSpeakStarted
字段类型描述
data.record_type
枚举值:event标识资源类型。
data.event_type
枚举值:conference.speak.started所传递的事件类型。
data.id
uuid标识资源类型。
data.payload.connection_id
字符串呼叫中使用的呼叫控制应用ID(原Telnyx连接ID)。
data.payload.creator_call_session_id
字符串发起会议的呼叫会话的唯一ID。
data.payload.conference_id
字符串播放文本转语音的会议ID。
data.payload.occurred_at
日期时间事件发生的ISO 8601格式时间。