List all Network Routes
Lists the routes of the account’s Networks. A Network’s list is its effective route table: the routes added with POST /network_routes (origin static) and the routes that its attachments install (origin attachment). Lookup is longest prefix within the Network.
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 response of client.networkRoutes.list()) {
console.log(response);
}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.network_routes.list()
print(page.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"),
)
networkRoutes, err := client.NetworkRoutes.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", networkRoutes.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 page = client.networkRoutes().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.network_routes.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->networkRoutes->list();
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx network-routes list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/network_routes \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "b6a10cb9-2d4e-4f61-9a3b-7e5c8d1f0a26",
"record_type": "network_route",
"network_id": "91446ee3-5b1c-4f0e-8d2a-6c7e9b0a1f24",
"cidr": "172.27.0.0/24",
"next_hop": {
"type": "wireguard_interface",
"id": "b6a10cb9-2d4e-4f61-9a3b-7e5c8d1f0a26"
},
"origin": "attachment",
"status": "active",
"created_at": "2026-10-21T15:04:05.123456Z"
},
{
"id": "e8a2c5d0-3f7b-4a19-b6d2-9c1e0f8a7b53",
"record_type": "network_route",
"network_id": "91446ee3-5b1c-4f0e-8d2a-6c7e9b0a1f24",
"cidr": "10.20.0.0/16",
"next_hop": {
"type": "tunnel",
"id": "62d438d2-8a51-4c5e-9d0c-1f6b2a7e4c39"
},
"origin": "static",
"status": "active",
"created_at": "2026-10-21T15:04:05.123456Z"
}
],
"meta": {
"cursors": {}
}
}{
"errors": [
{
"code": "10022",
"title": "Unprocessable Entity",
"detail": "filter[network_id] is required",
"source": {
"parameter": "filter[network_id]"
}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Consolidated filter parameter (deepObject style). Originally: filter[network_id], filter[origin], filter[next_hop.type], filter[cidr], filter[status]
Show child attributes
Show child attributes
Sorts the results by a field, ascending, or descending with a leading -. The default is -created_at.
cidr, -cidr, status, -status, created_at, -created_at "-created_at"
Consolidated page parameter (deepObject style). Originally: page[after], page[limit]
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 response of client.networkRoutes.list()) {
console.log(response);
}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.network_routes.list()
print(page.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"),
)
networkRoutes, err := client.NetworkRoutes.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", networkRoutes.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 page = client.networkRoutes().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.network_routes.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->networkRoutes->list();
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx network-routes list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/network_routes \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "b6a10cb9-2d4e-4f61-9a3b-7e5c8d1f0a26",
"record_type": "network_route",
"network_id": "91446ee3-5b1c-4f0e-8d2a-6c7e9b0a1f24",
"cidr": "172.27.0.0/24",
"next_hop": {
"type": "wireguard_interface",
"id": "b6a10cb9-2d4e-4f61-9a3b-7e5c8d1f0a26"
},
"origin": "attachment",
"status": "active",
"created_at": "2026-10-21T15:04:05.123456Z"
},
{
"id": "e8a2c5d0-3f7b-4a19-b6d2-9c1e0f8a7b53",
"record_type": "network_route",
"network_id": "91446ee3-5b1c-4f0e-8d2a-6c7e9b0a1f24",
"cidr": "10.20.0.0/16",
"next_hop": {
"type": "tunnel",
"id": "62d438d2-8a51-4c5e-9d0c-1f6b2a7e4c39"
},
"origin": "static",
"status": "active",
"created_at": "2026-10-21T15:04:05.123456Z"
}
],
"meta": {
"cursors": {}
}
}{
"errors": [
{
"code": "10022",
"title": "Unprocessable Entity",
"detail": "filter[network_id] is required",
"source": {
"parameter": "filter[network_id]"
}
}
]
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}