> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Endpoints

Every IAM endpoint lives under `/v2/iam/`, takes the organization owner's credential, and answers in the standard `data` and `meta` envelope.

## Conventions

* Lists take `page[size]`, up to 250 and 25 by default, and `page[number]`. `meta` carries `total_results`, `total_pages`, `page_number`, and `page_size`.
* Roles, grants, settings, and service accounts are scoped to the owner's organization. An ID of another organization answers `404`.
* Only the [organization owner](https://developers.telnyx.com/docs/iam/principals/organization-owner.md) manages IAM. Every `/v2/iam` route, the catalog and the service account routes included, answers `403` to anyone else, service account tokens included.
* The action catalog is the same for every organization.
* Role, statement, grant, user, and service account IDs are UUIDs. A user's ID is the one the [Organization Users API](https://developers.telnyx.com/api-reference/organization-users/list-organization-users.md) returns.

## Endpoints

Every endpoint in this section is available. The endpoints under [Preview](#preview) are not available yet.

| Method | Route | Action |
| - | - | - |
| `GET` | `/v2/iam/actions` | `actions.read` |
| `GET` | `/v2/iam/actions/{id}` | `actions.read` |
| `GET` | `/v2/iam/roles` | `iam_roles.read` |
| `POST` | `/v2/iam/roles` | `iam_roles.create` |
| `GET` | `/v2/iam/roles/{id}` | `iam_roles.read` |
| `PATCH` | `/v2/iam/roles/{id}` | `iam_roles.update` |
| `DELETE` | `/v2/iam/roles/{id}` | `iam_roles.delete` |
| `GET` | `/v2/iam/roles/{role_id}/statements` | `iam_role_statements.read` |
| `POST` | `/v2/iam/roles/{role_id}/statements` | `iam_role_statements.create` |
| `PUT` | `/v2/iam/roles/{role_id}/statements/{statement_id}` | `iam_role_statements.update` |
| `DELETE` | `/v2/iam/roles/{role_id}/statements/{statement_id}` | `iam_role_statements.delete` |
| `GET` | `/v2/iam/grants` | `iam_grants.read` |
| `POST` | `/v2/iam/grants` | `iam_grants.create` |
| `DELETE` | `/v2/iam/grants/{id}` | `iam_grants.delete` |
| `GET` | `/v2/iam/settings` | `iam_settings.read` |
| `PATCH` | `/v2/iam/settings` | `iam_settings.update` |
| `GET` | `/v2/iam/service_accounts` | `service_accounts.read` |
| `POST` | `/v2/iam/service_accounts` | `service_accounts.create` |
| `GET` | `/v2/iam/service_accounts/{id}` | `service_accounts.read` |
| `PATCH` | `/v2/iam/service_accounts/{id}` | `service_accounts.update` |
| `DELETE` | `/v2/iam/service_accounts/{id}` | `service_accounts.delete` |
| `POST` | `/v2/iam/service_accounts/{id}/actions/enable` | `service_accounts.enable` |
| `POST` | `/v2/iam/service_accounts/{id}/actions/disable` | `service_accounts.disable` |

### Service Account Tokens

Every token route below starts with `/v2/iam/service_accounts/{id}`.

| Method | Route | Action |
| - | - | - |
| `GET` | `/tokens` | `service_account_tokens.read` |
| `POST` | `/tokens` | `service_account_tokens.create` |
| `GET` | `/tokens/{token_id}` | `service_account_tokens.read` |
| `PATCH` | `/tokens/{token_id}` | `service_account_tokens.update` |
| `DELETE` | `/tokens/{token_id}` | `service_account_tokens.delete` |
| `POST` | `/tokens/{token_id}/actions/activate` | `service_account_tokens.activate` |
| `POST` | `/tokens/{token_id}/actions/deactivate` | `service_account_tokens.deactivate` |

### Decisions

| Method | Route | Action |
| - | - | - |
| `POST` | `/v2/iam/explain` | `iam.explain` |
| `POST` | `/v2/iam/simulate` | `iam.simulate` |

### Preview

These endpoints are not available yet. The pages that describe them show the intended behavior.

| Method | Route | Action |
| - | - | - |
| `GET` | `/v2/iam/audit_events` | |
| `GET` | `/v2/iam/api_keys` | `api_keys.read` |
| `POST` | `/v2/iam/api_keys` | `api_keys.create` |
| `GET` | `/v2/iam/api_keys/{id}` | `api_keys.read` |
| `DELETE` | `/v2/iam/api_keys/{id}` | `api_keys.delete` |
| `POST` | `/v2/iam/tokens` | |
| `GET` | `/v2/iam/guardrail` | |
| `PUT` | `/v2/iam/guardrail` | `iam.guardrail.update` |
| `POST` | `/v2/iam/projects` | `iam.projects.create` |
| `POST` | `/v2/iam/projects/{name}/resources` | |
| `GET` | `/v2/iam/delegations` | |
| `PUT` | `/v2/iam/delegations/{id}/grants` | |
| `PUT` | `/v2/iam/delegations/{id}/guardrail` | |
| `PUT` | `/v2/iam/delegation_defaults` | |
| `PUT` | `/v2/iam/delegation_defaults/guardrail` | |
| `POST` | `/v2/iam/settings/actions/apply_template` | |

Roles, their statements, and grants are described with their bodies on [Roles](https://developers.telnyx.com/docs/iam/access/roles.md) and [Grants](https://developers.telnyx.com/docs/iam/access/grants.md), the settings on [Enable IAM](https://developers.telnyx.com/docs/iam/organization/enable-iam.md), and the action catalog, `GET /v2/iam/actions`, on [Actions](https://developers.telnyx.com/docs/iam/access/actions.md).
