Create a Mobile Voice Connection
Create a new mobile voice connection.
POST
/
v2
/
mobile_voice_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 mobileVoiceConnection = await client.mobileVoiceConnections.create();
console.log(mobileVoiceConnection.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
)
mobile_voice_connection = client.mobile_voice_connections.create()
print(mobile_voice_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"),
)
mobileVoiceConnection, err := client.MobileVoiceConnections.New(context.TODO(), telnyx.MobileVoiceConnectionNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mobileVoiceConnection.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.mobilevoiceconnections.MobileVoiceConnectionCreateParams;
import com.telnyx.sdk.models.mobilevoiceconnections.MobileVoiceConnectionCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MobileVoiceConnectionCreateResponse mobileVoiceConnection = client.mobileVoiceConnections().create();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
mobile_voice_connection = telnyx.mobile_voice_connections.create
puts(mobile_voice_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 {
$mobileVoiceConnection = $client->mobileVoiceConnections->create(
active: true,
connectionName: 'connection_name',
inbound: ['channelLimit' => 0],
outbound: [
'channelLimit' => 0,
'outboundVoiceProfileID' => 'outbound_voice_profile_id',
],
tags: ['string'],
webhookAPIVersion: '1',
webhookEventFailoverURL: 'webhook_event_failover_url',
webhookEventURL: 'webhook_event_url',
webhookTimeoutSecs: 0,
);
var_dump($mobileVoiceConnection);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx mobile-voice-connections create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/mobile_voice_connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"active": true,
"connection_name": "Telnyx Mobile Voice IMS",
"webhook_api_version": "2",
"tags": [
"string"
],
"outbound": {
"channel_limit": 0,
"outbound_voice_profile_id": "string"
},
"inbound": {
"channel_limit": 0
}
}
'{
"data": {
"id": "<string>",
"record_type": "mobile_voice_connection",
"active": true,
"connection_name": "<string>",
"tags": [
"<string>"
],
"webhook_event_url": "<string>",
"webhook_event_failover_url": "<string>",
"webhook_timeout_secs": 123,
"outbound": {
"channel_limit": 123,
"outbound_voice_profile_id": "<string>"
},
"inbound": {
"channel_limit": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Available options:
1, 2 Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Successful response
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const mobileVoiceConnection = await client.mobileVoiceConnections.create();
console.log(mobileVoiceConnection.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
)
mobile_voice_connection = client.mobile_voice_connections.create()
print(mobile_voice_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"),
)
mobileVoiceConnection, err := client.MobileVoiceConnections.New(context.TODO(), telnyx.MobileVoiceConnectionNewParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", mobileVoiceConnection.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.mobilevoiceconnections.MobileVoiceConnectionCreateParams;
import com.telnyx.sdk.models.mobilevoiceconnections.MobileVoiceConnectionCreateResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MobileVoiceConnectionCreateResponse mobileVoiceConnection = client.mobileVoiceConnections().create();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
mobile_voice_connection = telnyx.mobile_voice_connections.create
puts(mobile_voice_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 {
$mobileVoiceConnection = $client->mobileVoiceConnections->create(
active: true,
connectionName: 'connection_name',
inbound: ['channelLimit' => 0],
outbound: [
'channelLimit' => 0,
'outboundVoiceProfileID' => 'outbound_voice_profile_id',
],
tags: ['string'],
webhookAPIVersion: '1',
webhookEventFailoverURL: 'webhook_event_failover_url',
webhookEventURL: 'webhook_event_url',
webhookTimeoutSecs: 0,
);
var_dump($mobileVoiceConnection);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx mobile-voice-connections create \
--api-key 'My API Key'curl --request POST \
--url https://api.telnyx.com/v2/mobile_voice_connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"active": true,
"connection_name": "Telnyx Mobile Voice IMS",
"webhook_api_version": "2",
"tags": [
"string"
],
"outbound": {
"channel_limit": 0,
"outbound_voice_profile_id": "string"
},
"inbound": {
"channel_limit": 0
}
}
'{
"data": {
"id": "<string>",
"record_type": "mobile_voice_connection",
"active": true,
"connection_name": "<string>",
"tags": [
"<string>"
],
"webhook_event_url": "<string>",
"webhook_event_failover_url": "<string>",
"webhook_timeout_secs": 123,
"outbound": {
"channel_limit": 123,
"outbound_voice_profile_id": "<string>"
},
"inbound": {
"channel_limit": 123
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}