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

# Update an External Connection

> Updates settings of an existing External Connection based on the parameters of the request.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/real-time-communications/external-connects.yml patch /external_connections/{id}
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/{id}:
    patch:
      tags:
        - External Connections
      summary: Update an External Connection
      description: >-
        Updates settings of an existing External Connection based on the
        parameters of the request.
      operationId: UpdateExternalConnection
      parameters:
        - $ref: '#/components/parameters/external-voice-integrations_id'
      requestBody:
        description: Parameters to be updated for the External Connection
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateExternalConnectionRequest'
      responses:
        '200':
          $ref: '#/components/responses/ExternalConnectionResponse'
        '401':
          description: Unauthorized
        '404':
          description: Resource not found
        '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.update('1293384261075731499', {
              outbound: { outbound_voice_profile_id: '1911630617284445511' },
            });


            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.update(
                id="1293384261075731499",
                outbound={
                    "outbound_voice_profile_id": "1911630617284445511"
                },
            )
            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.Update(\n\t\tcontext.TODO(),\n\t\t\"1293384261075731499\",\n\t\ttelnyx.ExternalConnectionUpdateParams{\n\t\t\tOutbound: telnyx.ExternalConnectionUpdateParamsOutbound{\n\t\t\t\tOutboundVoiceProfileID: \"1911630617284445511\",\n\t\t\t},\n\t\t},\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.ExternalConnectionUpdateParams;

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


            public final class Main {
                private Main() {}

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

                    ExternalConnectionUpdateParams params = ExternalConnectionUpdateParams.builder()
                        .id("1293384261075731499")
                        .outbound(ExternalConnectionUpdateParams.Outbound.builder()
                            .outboundVoiceProfileId("1911630617284445511")
                            .build())
                        .build();
                    ExternalConnectionUpdateResponse externalConnection = client.externalConnections().update(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            external_connection = telnyx.external_connections.update(
              "1293384261075731499",
              outbound: {outbound_voice_profile_id: "1911630617284445511"}
            )

            puts(external_connection)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $externalConnection = $client->externalConnections->update(
                '1293384261075731499',
                outbound: [
                  'outboundVoiceProfileID' => '1911630617284445511', 'channelLimit' => 10
                ],
                active: false,
                inbound: ['channelLimit' => 10],
                tags: ['tag1', 'tag2'],
                webhookEventFailoverURL: 'https://failover.example.com',
                webhookEventURL: 'https://example.com',
                webhookTimeoutSecs: 25,
              );

              var_dump($externalConnection);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx external-connections update \
              --api-key 'My API Key' \
              --id 1293384261075731499 \
              --outbound "{outbound_voice_profile_id: '1911630617284445511'}"
components:
  parameters:
    external-voice-integrations_id:
      name: id
      description: Identifies the resource.
      in: path
      required: true
      schema:
        type: string
        example: '1293384261075731499'
        x-format: int64
  schemas:
    UpdateExternalConnectionRequest:
      type: object
      title: Update External Connection Request
      required:
        - outbound
      properties:
        active:
          $ref: '#/components/schemas/ConnectionActive'
        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: ''
        tags:
          type: array
          items:
            type: string
          description: Tags associated with the connection.
          example:
            - tag1
            - tag2
        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
          required:
            - outbound_voice_profile_id
      example:
        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
    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

````