Skip to main content
The audit_logs functions are currently in ALPHA. The API may change without notice. A one-time warning is emitted on first use.
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.
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

ParameterTypeDescription
startTimeDate | stringOptional inclusive lower bound on created_at. Accepts an ISO 8601 string or a Date object. Defaults to 30 days before endTime.
endTimeDate | stringOptional inclusive upper bound on created_at. Accepts an ISO 8601 string or a Date object. Defaults to now.
userIdstringOptional base64-encoded user ID. When provided, filters results to entries for that user.
operationType"QUERY" | "MUTATION" | "SUBSCRIPTION"Optional operation type filter.
limitnumberMaximum number of results to return (1-100).
cursorstringPagination cursor from a previous response.

Audit Log Fields

Each returned AuditLog object includes:
FieldTypeDescription
idstringThe base64-encoded opaque identifier of the audit log entry.
userIdstringThe global identifier of the user who performed the action.
ipstringThe IP address from which the request originated.
operationType"QUERY" | "MUTATION" | "SUBSCRIPTION"The operation type.
operationNamestring | nullThe name of the GraphQL operation or REST endpoint.
operationTextstring | nullThe full text of the operation (query or mutation body, or REST request body).
variablesstring | nullJSON-serialized variables passed with the operation.
createdAtDateTimestamp when the action was recorded.