> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

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

**Expected Webhooks:**

- `conference.created`
- `conference.participant.joined`
- `conference.participant.left`
- `conference.ended`
- `conference.recording.saved`
- `conference.floor.changed`




## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/call-control/conferences.yml post /conferences
openapi: 3.1.0
info:
  title: Telnyx Conferences API
  version: 2.0.0
  description: API for Conferences.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /conferences:
    post:
      tags:
        - Conference Commands
      summary: Create conference
      description: >
        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.created`

        - `conference.participant.joined`

        - `conference.participant.left`

        - `conference.ended`

        - `conference.recording.saved`

        - `conference.floor.changed`
      operationId: CreateConference
      requestBody:
        description: Create a conference
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConferenceRequest'
      responses:
        '200':
          $ref: '#/components/responses/ConferenceResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '422':
          $ref: '#/components/responses/UnprocessableEntityResponse'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const conference = await client.conferences.create({
              call_control_id: 'v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg',
              name: 'Business',
            });

            console.log(conference.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            conference = client.conferences.create(
                call_control_id="v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
                name="Business",
            )
            print(conference.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tconference, err := client.Conferences.New(context.TODO(), telnyx.ConferenceNewParams{\n\t\tCallControlID: \"v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg\",\n\t\tName:          \"Business\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", conference.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
            import com.telnyx.sdk.models.conferences.ConferenceCreateParams;
            import com.telnyx.sdk.models.conferences.ConferenceCreateResponse;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    ConferenceCreateParams params = ConferenceCreateParams.builder()
                        .callControlId("v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg")
                        .name("Business")
                        .build();
                    ConferenceCreateResponse conference = client.conferences().create(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            conference = telnyx.conferences.create(
              call_control_id: "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
              name: "Business"
            )

            puts(conference)
        - lang: CLI
          source: |-
            telnyx conferences create \
              --api-key 'My API Key' \
              --call-control-id v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg \
              --name Business
components:
  schemas:
    CreateConferenceRequest:
      required:
        - call_control_id
        - name
      type: object
      title: Create Conference Request
      properties:
        call_control_id:
          description: Unique identifier and token for controlling the call
          example: >-
            v2:T02llQxIyaRkhfRKxgAP8nY511EhFLizdvdUKJiSw8d6A9BborherQczRrZvZakpWxBlpw48KyZQ==
          type: string
        name:
          description: Name of the conference
          example: Business
          type: string
        beep_enabled:
          description: >-
            Whether a beep sound should be played when participants join and/or
            leave the conference.
          enum:
            - always
            - never
            - on_enter
            - on_exit
          default: never
          example: on_exit
          type: string
        client_state:
          description: >-
            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.
          example: aGF2ZSBhIG5pY2UgZGF5ID1d
          type: string
        comfort_noise:
          description: Toggle background comfort noise.
          example: false
          type: boolean
          default: true
        command_id:
          description: >-
            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.
          example: 891510ac-f3e4-11e8-af5b-de00688a4901
          type: string
        duration_minutes:
          description: Time length (minutes) after which the conference will end.
          example: 5
          type: integer
        hold_audio_url:
          type: string
          example: http://example.com/message.wav
          description: >-
            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".
        hold_media_name:
          type: string
          example: my_media_uploaded_to_media_storage_api
          description: >-
            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".
        max_participants:
          description: >-
            The maximum number of active conference participants to allow. Must
            be between 2 and 800. Defaults to 250
          example: 3
          type: integer
        start_conference_on_create:
          description: >-
            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".
          example: false
          type: boolean
        region:
          description: >-
            Sets the region where the conference data will be hosted. Defaults
            to the region defined in user's data locality settings (Europe or
            US).
          example: US
          type: string
          enum:
            - Australia
            - Europe
            - Middle East
            - US
      example:
        call_control_id: v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg
        name: Business
        beep_enabled: always
        client_state: aGF2ZSBhIG5pY2UgZGF5ID1d
        command_id: 891510ac-f3e4-11e8-af5b-de00688a4901
        duration_minutes: 5
        hold_audio_url: http://www.example.com/audio.wav
        start_conference_on_create: false
        max_participants: 250
    Conference:
      type: object
      title: Conference
      required:
        - record_type
        - id
        - name
        - created_at
        - expires_at
      properties:
        record_type:
          type: string
          enum:
            - conference
          example: conference
        id:
          type: string
          description: Uniquely identifies the conference
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        name:
          type: string
          description: Name of the conference
          example: All hands meeting
        created_at:
          type: string
          description: ISO 8601 formatted date of when the conference was created
          example: '2019-01-23T18:10:02.574Z'
        expires_at:
          type: string
          description: ISO 8601 formatted date of when the conference will expire
          example: '2019-01-23T18:10:02.574Z'
        updated_at:
          type: string
          description: ISO 8601 formatted date of when the conference was last updated
          example: '2019-01-23T18:10:02.574Z'
        region:
          type: string
          description: Region where the conference is hosted
          example: sv1
        status:
          type: string
          enum:
            - init
            - in_progress
            - completed
          description: Status of the conference
          example: completed
        end_reason:
          type: string
          enum:
            - all_left
            - ended_via_api
            - host_left
            - time_exceeded
          description: Reason why the conference ended
          example: all_left
        ended_by:
          type: object
          description: >-
            IDs related to who ended the conference. It is expected for them to
            all be there or all be null
          properties:
            call_control_id:
              type: string
              description: Call Control ID which ended the conference
              example: >-
                v2:T02llQxIyaRkhfRKxgAP8nY511EhFLizdvdUKJiSw8d6A9BborherQczRrZvZakpWxBlpw48KyZQ==
            call_session_id:
              type: string
              description: Call Session ID which ended the conference
              example: 428c31b6-abf3-3bc1-b7f4-5013ef9657c1
        connection_id:
          type: string
          description: Identifies the connection associated with the conference
          example: 3fa85f64-9191-4567-b3fc-2c963f66afa6
      example:
        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
    call-control_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/call-control_Error'
    call-control_Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
          format: integer
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              format: json-pointer
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
  responses:
    ConferenceResponse:
      description: Successful response with details about a conference.
      content:
        application/json:
          schema:
            type: object
            title: Conference Response
            properties:
              data:
                $ref: '#/components/schemas/Conference'
    UnauthorizedResponse:
      description: >-
        Unauthorized. Authentication failed - the required authentication
        headers were either invalid or not included in the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/call-control_Errors'
          example:
            errors:
              - code: '10009'
                title: Authentication failed
                detail: >-
                  The required authentication headers were either invalid or not
                  included in the request.
                meta:
                  url: https://developers.telnyx.com/docs/overview/errors/10009
    UnprocessableEntityResponse:
      description: >-
        Unprocessable entity. The request was well-formed but could not be
        processed due to semantic errors. This includes validation errors,
        invalid parameter values, call state errors, conference errors, queue
        errors, recording/transcription errors, and business logic violations.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/call-control_Errors'
          examples:
            missing_required_parameter:
              summary: Missing required parameter
              value:
                errors:
                  - code: '10004'
                    title: Missing required parameter
                    detail: The 'to' parameter is required and cannot be blank.
                    source:
                      pointer: /to
            invalid_call_control_id:
              summary: Invalid call control ID
              value:
                errors:
                  - code: '90015'
                    title: Invalid Call Control ID
                    detail: The call_control_id provided was not valid.
                    source:
                      pointer: /call_control_id
            call_already_ended:
              summary: Call has already ended
              value:
                errors:
                  - code: '90018'
                    title: Call has already ended
                    detail: This call is no longer active and can't receive commands.
            call_not_answered:
              summary: Call not answered yet
              value:
                errors:
                  - code: '90034'
                    title: Call not answered yet
                    detail: >-
                      This call can't receive this command because it has not
                      been answered yet.
            cannot_record_before_audio_started:
              summary: Cannot record before audio started
              value:
                errors:
                  - code: '90020'
                    title: Call recording triggered before audio started
                    detail: >-
                      Call recording cannot be started until audio has commenced
                      on the call.
            transcription_already_active:
              summary: Transcription already active
              value:
                errors:
                  - code: '90054'
                    title: Call transcription is already in progress
                    detail: Call transcription can not be started more than once.
            ai_assistant_already_active:
              summary: AI Assistant already active
              value:
                errors:
                  - code: '90061'
                    title: AI Assistant is already in progress
                    detail: AI Assistant cannot be started more than once.
            conference_already_ended:
              summary: Conference has already ended
              value:
                errors:
                  - code: '90019'
                    title: Conference has already ended
                    detail: >-
                      This conference is no longer active and can't receive
                      commands.
            conference_name_conflict:
              summary: Conference name conflict
              value:
                errors:
                  - code: '90033'
                    title: Unable to execute command
                    detail: Conference with given name already exists and it's active.
            max_participants_reached:
              summary: Maximum participants reached
              value:
                errors:
                  - code: '90032'
                    title: Maximum number of participants reached
                    detail: >-
                      The maximum allowed value of `max_participants` has been
                      reached at 100.
            queue_full:
              summary: Queue is full
              value:
                errors:
                  - code: '90036'
                    title: Queue full
                    detail: The 'support' queue is full and can't accept more calls.
            call_already_in_queue:
              summary: Call already in queue
              value:
                errors:
                  - code: '90038'
                    title: Call already in queue
                    detail: Call can't be added to a queue it's already in.
            invalid_connection_id:
              summary: Invalid connection ID
              value:
                errors:
                  - code: '10015'
                    title: Invalid value for connection_id (Call Control App ID)
                    detail: >-
                      The requested connection_id (Call Control App ID) is
                      either invalid or does not exist. Only Call Control Apps
                      with valid webhook URL are accepted.
                    source:
                      pointer: /connection_id
            invalid_phone_number_format:
              summary: Invalid phone number format
              value:
                errors:
                  - code: '10016'
                    title: Phone number must be in +E164 format
                    detail: The 'to' parameter must be in E164 format.
                    source:
                      pointer: /to
            srtp_not_supported_for_pstn:
              summary: SRTP not supported for PSTN calls
              value:
                errors:
                  - source:
                      pointer: /media_encryption
                    title: Media encryption not supported for PSTN calls
                    detail: SRTP media encryption is not supported for PSTN calls.
                    code: '10011'
            fork_not_found:
              summary: Call is not forked
              value:
                errors:
                  - code: '90031'
                    title: Call is not currently forked
                    detail: >-
                      Can't stop forking, because the call isn't currently
                      forked.
            media_streaming_used:
              summary: Media streaming in use
              value:
                errors:
                  - code: '90045'
                    title: Media Streaming is used
                    detail: This command can't be issued when media streaming is used.
            invalid_enumerated_value:
              summary: Invalid enumerated value
              value:
                errors:
                  - code: '10032'
                    title: Invalid enumerated value
                    detail: 'The value must be one of: dual, single.'
                    source:
                      pointer: /record_channels
            value_outside_range:
              summary: Value outside of range
              value:
                errors:
                  - code: '10033'
                    title: Value outside of range
                    detail: The value is outside of allowed range 1 to 5000
                    source:
                      pointer: /max_participants
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````