Count connections
Returns the number of connections associated with the authenticated user, grouped by connection type, together with the connection limits that apply to the user. Forward-only connections are excluded from the counts.
GET
/
connections
/
count
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.connections.retrieveCount();
console.log(response.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
)
response = client.connections.retrieve_count()
print(response.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"),
)
response, err := client.Connections.GetCount(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var response = client.connections().retrieveCount();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.connections.retrieve_count
puts(response)<?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 {
$response = $client->connections->retrieveCount();
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx connections retrieve-count \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/connections/count \
--header 'Authorization: Bearer <token>'{
"data": {
"record_type": "connections_count",
"counts": {
"ip_connections": 12,
"credential_connections": 5,
"uac_connections": 0,
"fqdn_connections": 3,
"call_control_applications": 2,
"texml_applications": 1,
"third_party_provider_connections": 0,
"external_connections": 1,
"fax_connections": 0,
"mobile_voice_connections": 0,
"microsoft_teams_sbc_connections": 0,
"zoom_sbc_connections": 0,
"operator_connect_connections": 0
},
"limits": {
"global_limit": 10000
}
}
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.connections.retrieveCount();
console.log(response.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
)
response = client.connections.retrieve_count()
print(response.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"),
)
response, err := client.Connections.GetCount(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var response = client.connections().retrieveCount();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.connections.retrieve_count
puts(response)<?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 {
$response = $client->connections->retrieveCount();
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx connections retrieve-count \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/connections/count \
--header 'Authorization: Bearer <token>'{
"data": {
"record_type": "connections_count",
"counts": {
"ip_connections": 12,
"credential_connections": 5,
"uac_connections": 0,
"fqdn_connections": 3,
"call_control_applications": 2,
"texml_applications": 1,
"third_party_provider_connections": 0,
"external_connections": 1,
"fax_connections": 0,
"mobile_voice_connections": 0,
"microsoft_teams_sbc_connections": 0,
"zoom_sbc_connections": 0,
"operator_connect_connections": 0
},
"limits": {
"global_limit": 10000
}
}
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not understand the provided credentials.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}