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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# List monitor history

> Lists open and closed alert history.

`axiom.listMonitorHistory` lists open and closed alert history. When you omit the window, Automate.ax computes RFC3339 timestamps for the previous 30 minutes at execution time. Each item includes check ID, monitor name, state, and timestamp.

```ts automations/axiom-list-monitor-history.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { axiom } from "automate.ax/axiom"

export default automation("List monitor history", () => {
  onHttpRequest({ scope: "automation" })
  axiom.listMonitorHistory({
    monitorId: "monitor-id",
    startTime: "2026-08-29T12:00:00Z",
    endTime: "2026-08-30T12:00:00Z",
  })
})
```

## Inputs

`monitorId` is required. `startTime` and `endTime` accept RFC3339 timestamps. At execution, an omitted `startTime` defaults to the current time minus 30 minutes and an omitted `endTime` defaults to the current time. Automate.ax serializes both defaults as RFC3339 timestamps. Provide both inputs for a custom fixed window.

## Output

Returns an array of alert-history items. Each contains `checkId`, `name`, a `state` of `"open"` or `"closed"`, and `timestamp`. No state changes in the window returns `[]`.

## Permission and failures

The API token needs the organization-level `monitors|read` capability. Axiom returns an error for missing monitors, invalid RFC3339 timestamps, and reversed time windows.
