List IAM roles
Lists the organization’s roles, newest first.
Only the organization owner can call this endpoint. Its action is iam_roles.read. Other users and service account tokens get 403.
GET
/
iam
/
roles
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.iam.roles.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.iam.roles.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"),
)
roles, err := client.Iam.Roles.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", roles.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.iam().roles().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.iam.roles.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->iam->roles->list();
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx iam:roles list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/iam/roles \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "8c4a9715-0246-4c6f-9eca-390e13bd8af0",
"organization_id": "6e9d4c3a-2f8b-4a71-9c05-3b8e1f2d7a64",
"name": "test-number-provisioner",
"description": "Searches, orders and assigns test numbers",
"record_type": "iam_role",
"created_at": "2026-11-24T10:15:30.123456Z",
"updated_at": "2026-11-24T10:15:30.123456Z"
},
{
"id": "3741a8a1-5c2e-4b9d-a7f0-6e1c8d2b4f95",
"organization_id": "6e9d4c3a-2f8b-4a71-9c05-3b8e1f2d7a64",
"name": "billing-reader",
"description": null,
"record_type": "iam_role",
"created_at": "2026-11-22T16:03:11.482019Z",
"updated_at": "2026-11-22T16:03:11.482019Z"
}
],
"meta": {
"page_number": 1,
"page_size": 25,
"total_pages": 1,
"total_results": 2
}
}Authorizations
Query Parameters
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.iam.roles.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.iam.roles.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"),
)
roles, err := client.Iam.Roles.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", roles.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.iam().roles().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.iam.roles.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->iam->roles->list();
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx iam:roles list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/iam/roles \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "8c4a9715-0246-4c6f-9eca-390e13bd8af0",
"organization_id": "6e9d4c3a-2f8b-4a71-9c05-3b8e1f2d7a64",
"name": "test-number-provisioner",
"description": "Searches, orders and assigns test numbers",
"record_type": "iam_role",
"created_at": "2026-11-24T10:15:30.123456Z",
"updated_at": "2026-11-24T10:15:30.123456Z"
},
{
"id": "3741a8a1-5c2e-4b9d-a7f0-6e1c8d2b4f95",
"organization_id": "6e9d4c3a-2f8b-4a71-9c05-3b8e1f2d7a64",
"name": "billing-reader",
"description": null,
"record_type": "iam_role",
"created_at": "2026-11-22T16:03:11.482019Z",
"updated_at": "2026-11-22T16:03:11.482019Z"
}
],
"meta": {
"page_number": 1,
"page_size": 25,
"total_pages": 1,
"total_results": 2
}
}