> ## Documentation Index
> Fetch the complete documentation index at: https://arize-ax.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Audit Logs

> Query the account audit log for administrative and API activity using the Arize TypeScript SDK.

<Note>
  The `audit_logs` functions are currently in **ALPHA**. The API may change without notice. A one-time warning is emitted on first use.
</Note>

Audit log entries record administrative and API activity in your account. The caller must be an account admin and the account must have audit logging enabled.

## List Audit Logs

List audit log entries for the account, ordered newest first. Supports time-window filtering, user filtering, operation type filtering, and cursor-based pagination.

```typescript theme={null}
import { listAuditLogs } from "@arizeai/ax-client";

const { data: logs, pagination } = await listAuditLogs({
  operationType: "MUTATION",  // "QUERY", "MUTATION", or "SUBSCRIPTION" (optional)
  userId: "your_user_id",     // filter by user (optional)
  startTime: new Date("2026-01-01T00:00:00Z"),  // optional, defaults to 30 days before endTime
  endTime: new Date(),                          // optional, defaults to now
  limit: 50,
});
```

### Parameters

| Parameter       | Type                                      | Description                                                                                                                          |
| --------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `startTime`     | `Date \| string`                          | Optional inclusive lower bound on `created_at`. Accepts an ISO 8601 string or a `Date` object. Defaults to 30 days before `endTime`. |
| `endTime`       | `Date \| string`                          | Optional inclusive upper bound on `created_at`. Accepts an ISO 8601 string or a `Date` object. Defaults to now.                      |
| `userId`        | `string`                                  | Optional base64-encoded user ID. When provided, filters results to entries for that user.                                            |
| `operationType` | `"QUERY" \| "MUTATION" \| "SUBSCRIPTION"` | Optional operation type filter.                                                                                                      |
| `limit`         | `number`                                  | Maximum number of results to return (1-100).                                                                                         |
| `cursor`        | `string`                                  | Pagination cursor from a previous response.                                                                                          |

### Audit Log Fields

Each returned `AuditLog` object includes:

| Field           | Type                                      | Description                                                                    |
| --------------- | ----------------------------------------- | ------------------------------------------------------------------------------ |
| `id`            | `string`                                  | The base64-encoded opaque identifier of the audit log entry.                   |
| `userId`        | `string`                                  | The global identifier of the user who performed the action.                    |
| `ip`            | `string`                                  | The IP address from which the request originated.                              |
| `operationType` | `"QUERY" \| "MUTATION" \| "SUBSCRIPTION"` | The operation type.                                                            |
| `operationName` | `string \| null`                          | The name of the GraphQL operation or REST endpoint.                            |
| `operationText` | `string \| null`                          | The full text of the operation (query or mutation body, or REST request body). |
| `variables`     | `string \| null`                          | JSON-serialized variables passed with the operation.                           |
| `createdAt`     | `Date`                                    | Timestamp when the action was recorded.                                        |
