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

# Creates an External Connection

> Creates a new External Connection based on the parameters sent in the request. The external_sip_connection and outbound voice profile id are required. Once created, you can assign phone numbers to your application using the `/phone_numbers` endpoint.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/real-time-communications/external-connects.yml post /external_connections
openapi: 3.1.0
info:
  title: Telnyx External Connects API
  version: 2.0.0
  description: API for External connects.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /external_connections:
    post:
      tags:
        - External Connections
      summary: Creates an External Connection
      description: >-
        Creates a new External Connection based on the parameters sent in the
        request. The external_sip_connection and outbound voice profile id are
        required. Once created, you can assign phone numbers to your application
        using the `/phone_numbers` endpoint.
      operationId: CreateExternalConnection
      parameters: []
      requestBody:
        description: Parameters that can be set when creating a External Connection
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateExternalConnectionRequest'
      responses:
        '201':
          $ref: '#/components/responses/ExternalConnectionResponse'
        '422':
          description: Bad request
      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 externalConnection = await client.externalConnections.create({
              external_sip_connection: 'zoom',
              outbound: {},
            });

            console.log(externalConnection.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
            )
            external_connection = client.external_connections.create(
                external_sip_connection="zoom",
                outbound={},
            )
            print(external_connection.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\texternalConnection, err := client.ExternalConnections.New(context.TODO(), telnyx.ExternalConnectionNewParams{\n\t\tExternalSipConnection: telnyx.ExternalConnectionNewParamsExternalSipConnectionZoom,\n\t\tOutbound:              telnyx.ExternalConnectionNewParamsOutbound{},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", externalConnection.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.externalconnections.ExternalConnectionCreateParams;

            import
            com.telnyx.sdk.models.externalconnections.ExternalConnectionCreateResponse;


            public final class Main {
                private Main() {}

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

                    ExternalConnectionCreateParams params = ExternalConnectionCreateParams.builder()
                        .externalSipConnection(ExternalConnectionCreateParams.ExternalSipConnection.ZOOM)
                        .outbound(ExternalConnectionCreateParams.Outbound.builder().build())
                        .build();
                    ExternalConnectionCreateResponse externalConnection = client.externalConnections().create(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            external_connection =
            telnyx.external_connections.create(external_sip_connection: :zoom,
            outbound: {})


            puts(external_connection)
        - lang: CLI
          source: |-
            telnyx external-connections create \
              --api-key 'My API Key' \
              --external-sip-connection zoom \
              --outbound '{}'
components:
  schemas:
    CreateExternalConnectionRequest:
      type: object
      title: Create External Connection Request
      required:
        - external_sip_connection
        - outbound
      properties:
        active:
          $ref: '#/components/schemas/ConnectionActive'
        external_sip_connection:
          $ref: '#/components/schemas/ExternalSipConnectionZoomOnly'
        tags:
          type: array
          items:
            type: string
          description: Tags associated with the connection.
          example:
            - tag1
            - tag2
        webhook_event_url:
          type: string
          format: uri
          description: >-
            The URL where webhooks related to this connection will be sent. Must
            include a scheme, such as 'https'.
          example: https://example.com
        webhook_event_failover_url:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            The failover URL where webhooks related to this connection will be
            sent if sending to the primary URL fails. Must include a scheme,
            such as 'https'.
          example: https://failover.example.com
          default: ''
        webhook_timeout_secs:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 30
          description: Specifies how many seconds to wait before timing out a webhook.
          example: 25
          default: null
        inbound:
          type: object
          properties:
            outbound_voice_profile_id:
              type: string
              description: The ID of the outbound voice profile to use for inbound calls.
              example: 12345678-1234-1234-1234-123456789012
            channel_limit:
              type: integer
              description: >-
                When set, this will limit the number of concurrent inbound calls
                to phone numbers associated with this connection.
              default: null
              example: 10
          required:
            - outbound_voice_profile_id
        outbound:
          type: object
          properties:
            channel_limit:
              type: integer
              description: >-
                When set, this will limit the number of concurrent outbound
                calls to phone numbers associated with this connection.
              default: null
              example: 10
            outbound_voice_profile_id:
              $ref: >-
                #/components/schemas/external-voice-integrations_OutboundVoiceProfileId
      example:
        external_sip_connection: zoom
        active: false
        outbound:
          outbound_voice_profile_id: '1911630617284445511'
    ConnectionActive:
      title: Connection Active
      type: boolean
      description: Specifies whether the connection can be used.
      default: true
      example: false
    ExternalSipConnectionZoomOnly:
      title: External SIP Connection
      type: string
      description: The service that will be consuming this connection.
      enum:
        - zoom
      default: zoom
      example: zoom
    external-voice-integrations_OutboundVoiceProfileId:
      title: Outbound Voice Profile ID
      type: string
      description: Identifies the associated outbound voice profile.
      example: '1293384261075731499'
      x-format: int64
    ExternalConnection:
      type: object
      title: External Connection
      properties:
        id:
          $ref: '#/components/schemas/external-voice-integrations_IntId'
        record_type:
          type: string
          description: Identifies the type of the resource.
          example: external_connection
        active:
          $ref: '#/components/schemas/ConnectionActive'
        credential_active:
          $ref: '#/components/schemas/CredentialActive'
        external_sip_connection:
          $ref: '#/components/schemas/ExternalSipConnection'
        tags:
          type: array
          items:
            type: string
          description: Tags associated with the connection.
          example:
            - tag1
            - tag2
        webhook_event_url:
          type: string
          format: uri
          description: >-
            The URL where webhooks related to this connection will be sent. Must
            include a scheme, such as 'https'.
          example: https://example.com
        webhook_event_failover_url:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            The failover URL where webhooks related to this connection will be
            sent if sending to the primary URL fails. Must include a scheme,
            such as 'https'.
          example: https://failover.example.com
          default: ''
        webhook_api_version:
          type: string
          description: Determines which webhook format will be used, Telnyx API v1 or v2.
          enum:
            - '1'
            - '2'
          example: '1'
          default: '1'
        webhook_timeout_secs:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 30
          description: Specifies how many seconds to wait before timing out a webhook.
          example: 25
          default: null
        inbound:
          type: object
          properties:
            channel_limit:
              type: integer
              description: >-
                When set, this will limit the number of concurrent inbound calls
                to phone numbers associated with this connection.
              default: null
              example: 10
        outbound:
          type: object
          properties:
            channel_limit:
              type: integer
              description: >-
                When set, this will limit the number of concurrent outbound
                calls to phone numbers associated with this connection.
              default: null
              example: 10
            outbound_voice_profile_id:
              $ref: >-
                #/components/schemas/external-voice-integrations_OutboundVoiceProfileId
        created_at:
          type: string
          description: ISO 8601 formatted date indicating when the resource was created.
          example: '2018-02-02T22:25:27.521Z'
        updated_at:
          type: string
          description: ISO 8601 formatted date indicating when the resource was updated.
          example: '2018-02-02T22:25:27.521Z'
      example:
        id: '1930241863466354012'
        record_type: external_connection
        external_sip_connection: zoom
        credential_active: false
        active: false
        created_at: '2022-06-29T19:23:59Z'
        updated_at: '2022-06-29T19:39:47Z'
        outbound:
          outbound_voice_profile_id: '1911630617284445511'
    external-voice-integrations_IntId:
      title: Int ID
      type: string
      description: Uniquely identifies the resource.
      example: '1293384261075731499'
      x-format: int64
    CredentialActive:
      title: Credential Active
      description: If the credential associated with this service is active.
      type: boolean
      default: false
      example: true
    ExternalSipConnection:
      title: External SIP Connection
      type: string
      description: The service that will be consuming this connection.
      enum:
        - zoom
        - operator_connect
      default: zoom
      example: zoom
  responses:
    ExternalConnectionResponse:
      description: Successful response
      content:
        application/json:
          schema:
            type: object
            title: External Connection Response
            properties:
              data:
                $ref: '#/components/schemas/ExternalConnection'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````