List enterprises
Return the enterprises you own, paginated. The default page size is 20; the maximum is 250.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const enterprisePublic of client.enterprises.list()) {
console.log(enterprisePublic.id);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.enterprises.list()
page = page.data[0]
print(page.id)
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"),
)
page, err := client.Enterprises.List(context.TODO(), telnyx.EnterpriseListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.enterprises.EnterpriseListPage;
import com.telnyx.sdk.models.enterprises.EnterpriseListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
EnterpriseListPage page = client.enterprises().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.enterprises.list
puts(page)<?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 {
$page = $client->enterprises->list(
filterLegalNameContains: 'Acme',
legalName: 'Acme',
pageNumber: 1,
pageSize: 10,
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx enterprises list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/enterprises \
--header 'Authorization: Bearer <token>'Authorizations
Telnyx API key. Generate one at https://portal.telnyx.com/#/app/api-keys.
Query Parameters
1-based page number. Out-of-range values return an empty page with correct meta.
x >= 11
Items per page. Default 10. Maximum 250; values above are clamped to 250.
1 <= x <= 25010
Filter by legal name (partial match).
"Acme"
Case-insensitive partial match on legal name.
"Acme"
Response
Paginated list of enterprises.
Show child attributes
Show child attributes
JSON:API pagination metadata returned with every paginated list response. Page numbering is 1-based. page_size reports the number of items actually returned in data for this page; the requested size is taken from the page[size] query parameter.
Show child attributes
Show child attributes
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const enterprisePublic of client.enterprises.list()) {
console.log(enterprisePublic.id);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.enterprises.list()
page = page.data[0]
print(page.id)
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"),
)
page, err := client.Enterprises.List(context.TODO(), telnyx.EnterpriseListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.enterprises.EnterpriseListPage;
import com.telnyx.sdk.models.enterprises.EnterpriseListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
EnterpriseListPage page = client.enterprises().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.enterprises.list
puts(page)<?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 {
$page = $client->enterprises->list(
filterLegalNameContains: 'Acme',
legalName: 'Acme',
pageNumber: 1,
pageSize: 10,
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx enterprises list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/enterprises \
--header 'Authorization: Bearer <token>'