import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const conference = await client.conferences.create({
call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
name: 'Business',
});
console.log(conference.data);{
"data": {
"record_type": "conference",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "All hands meeting",
"created_at": "2019-01-23T18:10:02.574Z",
"expires_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"region": "sv1",
"status": "completed",
"end_reason": "all_left",
"ended_by": {
"call_control_id": "v2:T02llQxIyaRkhfRKxgAP8nY511EhFLizdvdUKJiSw8d6A9BborherQczRrZvZakpWxBlpw48KyZQ==",
"call_session_id": "428c31b6-abf3-3bc1-b7f4-5013ef9657c1"
},
"connection_id": "3fa85f64-9191-4567-b3fc-2c963f66afa6"
}
}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.
Expected Webhooks:
conference.createdconference.participant.joinedconference.participant.leftconference.endedconference.recording.savedconference.floor.changedimport Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const conference = await client.conferences.create({
call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
name: 'Business',
});
console.log(conference.data);{
"data": {
"record_type": "conference",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "All hands meeting",
"created_at": "2019-01-23T18:10:02.574Z",
"expires_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"region": "sv1",
"status": "completed",
"end_reason": "all_left",
"ended_by": {
"call_control_id": "v2:T02llQxIyaRkhfRKxgAP8nY511EhFLizdvdUKJiSw8d6A9BborherQczRrZvZakpWxBlpw48KyZQ==",
"call_session_id": "428c31b6-abf3-3bc1-b7f4-5013ef9657c1"
},
"connection_id": "3fa85f64-9191-4567-b3fc-2c963f66afa6"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Create a conference
Unique identifier and token for controlling the call
"v2:T02llQxIyaRkhfRKxgAP8nY511EhFLizdvdUKJiSw8d6A9BborherQczRrZvZakpWxBlpw48KyZQ=="
Name of the conference
"Business"
Whether a beep sound should be played when participants join and/or leave the conference.
always, never, on_enter, on_exit "on_exit"
Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string. The client_state will be updated for the creator call leg and will be used for all webhooks related to the created conference.
"aGF2ZSBhIG5pY2UgZGF5ID1d"
Toggle background comfort noise.
false
Use this field to avoid execution of duplicate commands. Telnyx will ignore subsequent commands with the same command_id as one that has already been executed.
"891510ac-f3e4-11e8-af5b-de00688a4901"
Time length (minutes) after which the conference will end.
5
The URL of a file to be played to participants joining the conference. The URL can point to either a WAV or MP3 file. hold_media_name and hold_audio_url cannot be used together in one request. Takes effect only when "start_conference_on_create" is set to "false".
"http://example.com/message.wav"
The media_name of a file to be played to participants joining the conference. The media_name must point to a file previously uploaded to api.telnyx.com/v2/media by the same user/organization. The file must either be a WAV or MP3 file. Takes effect only when "start_conference_on_create" is set to "false".
"my_media_uploaded_to_media_storage_api"
The maximum number of active conference participants to allow. Must be between 2 and 800. Defaults to 250
3
Whether the conference should be started on creation. If the conference isn't started all participants that join are automatically put on hold. Defaults to "true".
false
Sets the region where the conference data will be hosted. Defaults to the region defined in user's data locality settings (Europe or US).
Australia, Europe, Middle East, US "US"
Successful response with details about a conference.
Show child attributes
conference "conference"
Uniquely identifies the conference
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
Name of the conference
"All hands meeting"
ISO 8601 formatted date of when the conference was created
"2019-01-23T18:10:02.574Z"
ISO 8601 formatted date of when the conference will expire
"2019-01-23T18:10:02.574Z"
ISO 8601 formatted date of when the conference was last updated
"2019-01-23T18:10:02.574Z"
Region where the conference is hosted
"sv1"
Status of the conference
init, in_progress, completed "completed"
Reason why the conference ended
all_left, ended_via_api, host_left, time_exceeded "all_left"
IDs related to who ended the conference. It is expected for them to all be there or all be null
Show child attributes
Identifies the connection associated with the conference
"3fa85f64-9191-4567-b3fc-2c963f66afa6"
{
"record_type": "conference",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "All hands meeting",
"created_at": "2019-01-23T18:10:02.574Z",
"expires_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"region": "sv1",
"status": "completed",
"end_reason": "all_left",
"ended_by": {
"call_control_id": "v2:T02llQxIyaRkhfRKxgAP8nY511EhFLizdvdUKJiSw8d6A9BborherQczRrZvZakpWxBlpw48KyZQ==",
"call_session_id": "428c31b6-abf3-3bc1-b7f4-5013ef9657c1"
},
"connection_id": "3fa85f64-9191-4567-b3fc-2c963f66afa6"
}Was this page helpful?