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

# Create monitor

> Creates a new monitor

Requires `monitors:read_write` permission.

<ParamField body="name" type="string" required>
  Monitor name (1–255 characters)
</ParamField>

<ParamField body="check_type" type="string" required>
  `http`, `tcp`, `dns`, `heartbeat`, or `synthetic`
</ParamField>

<ParamField body="config" type="object" required>
  Type-specific configuration. See [Monitors](/monitors) for fields per type.
</ParamField>

<ParamField body="interval_seconds" type="integer" default={180}>
  Check interval in seconds (minimum: 30)
</ParamField>

<ParamField body="timeout_ms" type="integer" default={10000}>
  Timeout in milliseconds (range: 1000–60000)
</ParamField>

<ParamField body="confirm_down_minutes" type="integer" default={1}>
  Minutes of consecutive failures before marking down (HTTP, TCP, DNS, heartbeat)
</ParamField>

<ParamField body="confirm_up_minutes" type="integer" default={3}>
  Minutes of consecutive successes before marking recovered (HTTP, TCP, DNS, heartbeat)
</ParamField>

<ParamField body="confirm_down_after" type="integer" default={3}>
  Consecutive failures before marking down (synthetic monitors only, range: 1–10)
</ParamField>

<ParamField body="confirm_up_after" type="integer" default={1}>
  Consecutive passes before marking recovered (synthetic monitors only, range: 1–10)
</ParamField>

<ParamField body="enabled" type="boolean" default={true}>
  Whether the monitor is active
</ParamField>

<ParamField body="alert_channel_ids" type="string[]">
  List of alert channel IDs to attach. If omitted, channels with `default_for_new_monitors` are linked automatically.
</ParamField>

<ResponseExample>
  ```json 201 theme={null}
  {
    "data": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Marketing site",
      "check_type": "http",
      "enabled": true,
      "interval_seconds": 180,
      "timeout_ms": 10000,
      "confirm_down_minutes": 1,
      "confirm_up_minutes": 3,
      "config": {
        "url": "https://example.com",
        "method": "GET",
        "expected_status_codes": [200],
        "follow_redirects": true
      },
      "current_state": "pending",
      "alert_channel_ids": ["660e8400-e29b-41d4-a716-446655440000"],
      "inserted_at": "2025-03-01T12:00:00Z",
      "updated_at": "2025-03-01T12:00:00Z"
    }
  }
  ```
</ResponseExample>
