List phone-number batches for a DIR
List the phone-number batches submitted under a DIR. The enterprise is resolved server-side from the DIR id.
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 phoneNumberBatchListResponse of client.dir.phoneNumberBatches.list(
'16635d38-75a6-4481-82e8-69af60e05011',
)) {
console.log(phoneNumberBatchListResponse.batch_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.dir.phone_number_batches.list(
dir_id="16635d38-75a6-4481-82e8-69af60e05011",
)
page = page.data[0]
print(page.batch_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.Dir.PhoneNumberBatches.List(
context.TODO(),
"16635d38-75a6-4481-82e8-69af60e05011",
telnyx.DirPhoneNumberBatchListParams{},
)
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.dir.phonenumberbatches.PhoneNumberBatchListPage;
import com.telnyx.sdk.models.dir.phonenumberbatches.PhoneNumberBatchListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
PhoneNumberBatchListPage page = client.dir().phoneNumberBatches().list("16635d38-75a6-4481-82e8-69af60e05011");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.dir.phone_number_batches.list("16635d38-75a6-4481-82e8-69af60e05011")
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->dir->phoneNumberBatches->list(
'16635d38-75a6-4481-82e8-69af60e05011',
filterStatus: 'submitted',
pageNumber: 1,
pageSize: 20,
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx dir:phone-number-batches list \
--api-key 'My API Key' \
--dir-id 16635d38-75a6-4481-82e8-69af60e05011curl --request GET \
--url https://api.telnyx.com/v2/dir/{dir_id}/phone_number_batches \
--header 'Authorization: Bearer <token>'{
"data": [
{
"batch_id": "ba74cfc6-d32b-467a-9b08-86fd154c23f7",
"dir_id": "74e1d8ed-fbdb-45a7-bbb0-a09c1184eb3d",
"dir_display_name": "Acme Plumbing",
"enterprise_id": "5c987b82-2e3b-442a-afbc-0ba3c515f561",
"status": "submitted",
"total_count": 1,
"submitted_at": "2026-04-26T18:14:37.065870Z",
"documents": [
{
"document_id": "2a7e8337-e803-4057-a4ae-26c40eb0bc6c",
"document_type": "business_registration",
"description": "Certificate of incorporation."
}
],
"phone_numbers": [
{
"id": "1f56eb76-4078-4af7-ad4d-564b027256ee",
"dir_id": "16635d38-75a6-4481-82e8-69af60e05011",
"enterprise_id": "4a6192a4-573d-446d-b3ce-aff9117272a6",
"phone_number": "+19493253498",
"batch_id": "0a4b1f5e-2f12-4c0c-9a98-9b3a7d8b8e62",
"loa_document_id": null,
"status": "submitted",
"rejection_reason": {
"code": "documentation_incomplete",
"title": "Documentation incomplete",
"detail": "Provided documents do not establish business identity.",
"message": "Please re-upload a clearer scan of the certificate."
},
"created_at": "2026-04-26T18:11:42.850928Z",
"updated_at": "2026-04-26T18:12:11.123456Z",
"verified_at": "2026-04-26T18:12:11.123456Z"
}
]
}
],
"meta": {
"total_pages": 3,
"total_results": 42,
"page_number": 1,
"page_size": 20
}
}Authorizations
Telnyx API key. Generate one at https://portal.telnyx.com/#/app/api-keys.
Path Parameters
The DIR id. Lowercase UUID.
"16635d38-75a6-4481-82e8-69af60e05011"
Query Parameters
1-based page number. Out-of-range values return an empty page with correct meta.
x >= 11
Items per page. Maximum 250; values above are clamped to 250.
1 <= x <= 25020
Restrict to batches whose aggregate status equals this value. Phone-number lifecycle status.
submitted/in_review- Telnyx is reviewing the batch this number belongs to.verified- approved; the DIR's display identity will be shown on outbound calls from this number.unsuccessful- Telnyx rejected this submission; the customer may re-add to retry.suspended- temporarily disabled (e.g. by an active infringement claim on the DIR).expired- verification expired; re-add to renew.permanently_rejected- terminal; cannot be re-added on this or any other DIR you own.
submitted, in_review, verified, unsuccessful, suspended, expired, permanently_rejected Response
Paginated list of batches.
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 phoneNumberBatchListResponse of client.dir.phoneNumberBatches.list(
'16635d38-75a6-4481-82e8-69af60e05011',
)) {
console.log(phoneNumberBatchListResponse.batch_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.dir.phone_number_batches.list(
dir_id="16635d38-75a6-4481-82e8-69af60e05011",
)
page = page.data[0]
print(page.batch_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.Dir.PhoneNumberBatches.List(
context.TODO(),
"16635d38-75a6-4481-82e8-69af60e05011",
telnyx.DirPhoneNumberBatchListParams{},
)
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.dir.phonenumberbatches.PhoneNumberBatchListPage;
import com.telnyx.sdk.models.dir.phonenumberbatches.PhoneNumberBatchListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
PhoneNumberBatchListPage page = client.dir().phoneNumberBatches().list("16635d38-75a6-4481-82e8-69af60e05011");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.dir.phone_number_batches.list("16635d38-75a6-4481-82e8-69af60e05011")
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->dir->phoneNumberBatches->list(
'16635d38-75a6-4481-82e8-69af60e05011',
filterStatus: 'submitted',
pageNumber: 1,
pageSize: 20,
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx dir:phone-number-batches list \
--api-key 'My API Key' \
--dir-id 16635d38-75a6-4481-82e8-69af60e05011curl --request GET \
--url https://api.telnyx.com/v2/dir/{dir_id}/phone_number_batches \
--header 'Authorization: Bearer <token>'{
"data": [
{
"batch_id": "ba74cfc6-d32b-467a-9b08-86fd154c23f7",
"dir_id": "74e1d8ed-fbdb-45a7-bbb0-a09c1184eb3d",
"dir_display_name": "Acme Plumbing",
"enterprise_id": "5c987b82-2e3b-442a-afbc-0ba3c515f561",
"status": "submitted",
"total_count": 1,
"submitted_at": "2026-04-26T18:14:37.065870Z",
"documents": [
{
"document_id": "2a7e8337-e803-4057-a4ae-26c40eb0bc6c",
"document_type": "business_registration",
"description": "Certificate of incorporation."
}
],
"phone_numbers": [
{
"id": "1f56eb76-4078-4af7-ad4d-564b027256ee",
"dir_id": "16635d38-75a6-4481-82e8-69af60e05011",
"enterprise_id": "4a6192a4-573d-446d-b3ce-aff9117272a6",
"phone_number": "+19493253498",
"batch_id": "0a4b1f5e-2f12-4c0c-9a98-9b3a7d8b8e62",
"loa_document_id": null,
"status": "submitted",
"rejection_reason": {
"code": "documentation_incomplete",
"title": "Documentation incomplete",
"detail": "Provided documents do not establish business identity.",
"message": "Please re-upload a clearer scan of the certificate."
},
"created_at": "2026-04-26T18:11:42.850928Z",
"updated_at": "2026-04-26T18:12:11.123456Z",
"verified_at": "2026-04-26T18:12:11.123456Z"
}
]
}
],
"meta": {
"total_pages": 3,
"total_results": 42,
"page_number": 1,
"page_size": 20
}
}