> ## 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.

# Access Logs

Access logs list the requests IAM decided in the organization: who sent each one, the action it needed, the decision, the reason, and the roles behind it. They show what a key or a service account did, and why a request was refused. Only the [organization owner](https://developers.telnyx.com/docs/iam/principals/organization-owner.md) reads them, with `GET /v2/iam/access_logs`.

## An Entry

```json GET /v2/iam/access_logs?filter[decision]=deny theme={null}
{
  "data": [
    {
      "timestamp": "2026-11-20T14:05:12Z",
      "method": "PATCH",
      "path": "/v2/connections/1293384261075731499",
      "action": "connection.update",
      "decision": "deny",
      "decision_reason": "action_not_granted",
      "allowed_role_ids": [],
      "denied_role_ids": [],
      "service_account_id": "e6cd1ff6-6e3a-4ff3-88d5-2234142c1df2",
      "cred_type": "sat",
      "record_type": "iam_access_log",
      ...
    }
  ],
  "metadata": { "cursors": { "after": "..." } }
}
```

| Field | What It Holds |
| - | - |
| `action` | The action IAM decided: the one the route declared, or `managed_account.impersonate` for a request refused on entering a [managed organization](https://developers.telnyx.com/docs/iam/troubleshooting/evaluation-sequence.md#working-in-a-managed-organization-needs-an-action-too). |
| `decision` | `allow` or `deny`, the answer the request got. |
| `decision_reason` | Why, such as `action_allowed`, `action_not_granted`, or `credential_scope_not_allowed`. |
| `allowed_role_ids`, `denied_role_ids` | The granted roles with an allow or a deny statement for the action. |
| `user_id` | The user who sent the request. For a service account token, or a request sent into a managed organization, it holds an organization's ID. |
| `service_account_id` | The service account that sent the request, or `null`. |
| `cred_type`, `cred_id` | The credential the request used, such as `apikey`, `tmptok` for a session, `oauth2`, or `sat` for a service account token, and its ID. |
| `request_id`, `ip_ingress` | The request's ID, and the client address Telnyx saw. |

Access logs list only the requests IAM decided:

* Every request of a service account, or of a user other than the owner, once the organization has [enabled IAM](https://developers.telnyx.com/docs/iam/organization/enable-iam.md).
* The requests of a user other than the owner for the [actions every signed-in user holds](https://developers.telnyx.com/docs/iam/access/actions.md#actions-every-signed-in-user-holds), sent with a session or an OAuth token, whether or not the organization has enabled IAM.
* A request of the owner that IAM refused, such as one the [scope](https://developers.telnyx.com/docs/iam/credentials/scoped-keys.md) of the owner's API key does not allow. The owner holds no roles, so the owner's other requests are not listed.

Requests to routes that declare no [action](https://developers.telnyx.com/docs/iam/access/actions.md#routes-without-an-action) are never listed.

A request sent into a [managed organization](https://developers.telnyx.com/docs/iam/troubleshooting/evaluation-sequence.md#working-in-a-managed-organization-needs-an-action-too) with `X-Managed-Account-Id` is decided for its sender, so the rules above apply to the sender and the sender's organization, but the entry goes to the managed organization's access logs. For such a request, the sender's own organization lists only a refused `managed_account.impersonate`.

Preview An entry names the [delegation](https://developers.telnyx.com/docs/iam/access/delegations.md#a-delegation) a request came through, when a manager worked in a managed organization, and a managed organization's log names the manager org user who acted in it.

## Filters

| Parameter | What It Does |
| - | - |
| `filter[decision]` | Keeps the entries with this decision, `allow` or `deny`. |
| `filter[decision_reason]` | Keeps the entries with this reason. |
| `filter[action]` | Keeps the entries for this action. |
| `filter[role_id]` | Keeps the entries this role allowed or denied. |
| `filter[user_id]`, `filter[service_account_id]` | Keeps the entries of this user or service account. |
| `filter[cred_id]`, `filter[request_id]` | Keeps the entries of this credential or request. |
| `start_time`, `end_time` | The time range, as ISO 8601 times, at most 14 days long. `end_time` defaults to now, and `start_time` to 14 days before `end_time`. |
| `page[size]` | Up to 500 entries per page, 249 by default. |
| `page[after]` | The next page's cursor, from `metadata.cursors.after`. |

Entries come oldest first, and `metadata.cursors.after` is `null` on the last page. A range longer than 14 days, a `start_time` after `end_time`, or an invalid filter value or cursor answers `422`. When the logs cannot be read, the request answers `503`.

## Credential Inventory

`GET /v2/iam/api_keys` lists every API key of the organization with its `id`, its user, its status, and when it was last used. Once IAM is enabled, `GET /v2/iam/access_logs?filter[cred_id]={id}` lists the requests that key sent and the action each needed. The owner's keys appear only in the requests IAM refused.

Preview Every credential shows from where it was last used and the actions it sent in the last thirty days in one place, so a key that is really one server reading invoices can be moved to a [service account](https://developers.telnyx.com/docs/iam/principals/service-accounts.md) with exactly that role.
