Skip to main content
POST
/
external_connections
JavaScript
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);
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)
package main

import (
"context"
"fmt"

"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)

func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
externalConnection, err := client.ExternalConnections.New(context.TODO(), telnyx.ExternalConnectionNewParams{
ExternalSipConnection: telnyx.ExternalConnectionNewParamsExternalSipConnectionZoom,
Outbound: telnyx.ExternalConnectionNewParamsOutbound{},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", externalConnection.Data)
}
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);
}
}
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)
<?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->create(
externalSipConnection: 'zoom',
outbound: [
'channelLimit' => 10, 'outboundVoiceProfileID' => '1911630617284445511'
],
active: false,
inbound: [
'outboundVoiceProfileID' => '12345678-1234-1234-1234-123456789012',
'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();
}
telnyx external-connections create \
--api-key 'My API Key' \
--external-sip-connection zoom \
--outbound '{}'
curl --request POST \
--url https://api.telnyx.com/v2/external_connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_sip_connection": "zoom",
"active": false,
"outbound": {
"outbound_voice_profile_id": "1911630617284445511"
}
}
'
{
  "data": {
    "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"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Parameters that can be set when creating a External Connection

external_sip_connection
enum<string>
default:zoom
required

The service that will be consuming this connection.

Available options:
zoom
Example:

"zoom"

outbound
object
required
active
boolean
default:true

Specifies whether the connection can be used.

Example:

false

tags
string[]

Tags associated with the connection.

Example:
["tag1", "tag2"]
webhook_event_url
string<uri>

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
string<uri> | null
default:""

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"

webhook_timeout_secs
integer | null

Specifies how many seconds to wait before timing out a webhook.

Required range: 0 <= x <= 30
Example:

25

inbound
object

Response

Successful response

data
External Connection · object
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"
}
}