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

# Create monitor

> Creates a threshold, match-event, or anomaly monitor.

`axiom.createMonitor` creates a threshold, match-event, or anomaly monitor. Provide exactly one APL or MPL query plus interval and range minutes; `notifierIds` attaches destinations.

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

export default automation("Create monitor", () => {
  onHttpRequest({ scope: "automation" })
  axiom.createMonitor({
    name: "Error volume",
    type: "Threshold",
    aplQuery: "['production'] | where severity == 'error' | count",
    intervalMinutes: 5,
    rangeMinutes: 15,
    operator: "Above",
    threshold: 100,
  })
})
```

## Inputs

`name`, `type`, positive `intervalMinutes`, and positive `rangeMinutes` are required. Provide exactly one non-empty `aplQuery` or `mplQuery`. Optional settings include `operator`, `threshold`, anomaly `compareDays` from 1–7, `tolerance` from 0–100, notifier IDs, grouping and repeat behavior, no-data behavior, resolution behavior, whether the monitor is paused, a delay from 0–86,400 seconds, and positive run-count thresholds.

No optional monitor setting has an Automate.ax default; Axiom applies its service defaults when a field is omitted.

## Output

Returns the complete monitor with its Axiom `id` and audit timestamps or actor IDs when provided.

## Permission and failures

The API token needs the organization-level `monitors|create` capability. Axiom rejects invalid queries, settings incompatible with the selected monitor type, and unknown notifier IDs. This mutation is not retried automatically after an ambiguous provider response.
