List policies
Lists the instance’s policies, each in its current version.
GET
/
agent_gateways
/
{instance_id}
/
policies
JavaScript
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.agentGateways.policies.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.agent_gateways.policies.list(
"instance_id",
)
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"),
)
policies, err := client.AgentGateways.Policies.List(
context.TODO(),
"instance_id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", policies.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.agentGateways().policies().list("instance_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.agent_gateways.policies.list("instance_id")
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->agentGateways->policies->list(
'instance_id',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx agent-gateways:policies list \
--api-key 'My API Key' \
--instance-id 32ce035d-3165-4031-b1a7-a7c0c259590acurl --request GET \
--url https://api.telnyx.com/v2/agent_gateways/{instance_id}/policies \
--header 'Authorization: Bearer <token>'{
"data": [
{
"name": "baseline",
"description": "Mask personal data",
"base": null,
"guardrails": {
"add": [
"mask-pii"
],
"remove": []
},
"model": null,
"pipeline": null,
"created_at": "2026-11-02T12:58:53.995000Z",
"updated_at": "2026-11-02T12:58:53.995000Z"
},
{
"name": "strict",
"description": null,
"base": "baseline",
"guardrails": {
"add": [
"no-forbidden"
],
"remove": []
},
"model": "GLM-5.3.*",
"pipeline": null,
"created_at": "2026-11-02T12:58:54.285000Z",
"updated_at": "2026-11-02T12:58:54.285000Z"
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "The requested resource or URL could not be found.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10005"
}
}
]
}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
});
// Automatically fetches more pages as needed.
for await (const response of client.agentGateways.policies.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.agent_gateways.policies.list(
"instance_id",
)
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"),
)
policies, err := client.AgentGateways.Policies.List(
context.TODO(),
"instance_id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", policies.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.agentGateways().policies().list("instance_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.agent_gateways.policies.list("instance_id")
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->agentGateways->policies->list(
'instance_id',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx agent-gateways:policies list \
--api-key 'My API Key' \
--instance-id 32ce035d-3165-4031-b1a7-a7c0c259590acurl --request GET \
--url https://api.telnyx.com/v2/agent_gateways/{instance_id}/policies \
--header 'Authorization: Bearer <token>'{
"data": [
{
"name": "baseline",
"description": "Mask personal data",
"base": null,
"guardrails": {
"add": [
"mask-pii"
],
"remove": []
},
"model": null,
"pipeline": null,
"created_at": "2026-11-02T12:58:53.995000Z",
"updated_at": "2026-11-02T12:58:53.995000Z"
},
{
"name": "strict",
"description": null,
"base": "baseline",
"guardrails": {
"add": [
"no-forbidden"
],
"remove": []
},
"model": "GLM-5.3.*",
"pipeline": null,
"created_at": "2026-11-02T12:58:54.285000Z",
"updated_at": "2026-11-02T12:58:54.285000Z"
}
]
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "The requested resource or URL could not be found.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10005"
}
}
]
}