---
title: "Create a monitor"
method: POST
path: "/api/v1/monitors"
tags: ["monitors"]
---

# Create a monitor

`POST /api/v1/monitors`

## Request

- Base URL: `https://puzaricloud.in` (the document declares no server; this is the origin it was published from)
- URL: `https://puzaricloud.in/api/v1/monitors`
- Auth: none declared

## Request body

- MonitorIn
  - `name` string, nullable
  - `url` string, nullable: URL; host:port for tcp; domain for domain; provider slug or status URL for dependency; not used for heartbeat/flow
  - `mode` string
  - `selector` string, nullable
  - `keyword` string, nullable
  - `keyword_rule` string
  - `price_rule` string
  - `price_threshold` number, nullable
  - `interval_minutes` integer
  - `channel_ids` integer[]
  - `escalation_channel_ids` integer[]
  - `escalation_minutes` integer
  - `tags` string[]
  - `method` string
  - `headers` object
  - `body` string, nullable
  - `expect_status` string
  - `assertions` string, nullable: One rule per line: contains X | json a.b == 1 | header content-type contains json
  - `max_latency_ms` integer, nullable
  - `ssl_alert_days` integer
  - `security_alerts` boolean
  - `confirm_retry` boolean
  - `period_minutes` integer: heartbeat: expected ping period
  - `grace_minutes` integer: heartbeat: allowed lateness
  - `schedule_cron` string, nullable: heartbeat: cron expression instead of a period
  - `schedule_tz` string
  - `max_duration_minutes` integer, nullable
  - `repeat_alert_minutes` integer
  - `steps` object[], nullable: flow: list of steps {name, method, url, headers, body, expect_status, assertions, extract}
  - `domain_alert_days` integer
  - `dns_watch` string[]
  - `health_secret` string, nullable
  - `agent_id` integer, nullable: private location id (Pro+)
  - `slo_target` number, nullable: e.g. 99.9
  - `anomaly_alerts` boolean

## Response `201`

Successful Response

- MonitorOut
  - `id` integer, required
  - `name` string, required
  - `url` string, required
  - `mode` string, required
  - `tags` unknown[], required
    - unknown
  - `selector` string, nullable, required
  - `keyword` string, nullable, required
  - `interval_minutes` integer, required
  - `active` boolean, required
  - `is_up` boolean, nullable, required
  - `last_checked_at` string, date-time, nullable, required
  - `last_changed_at` string, date-time, nullable, required
  - `last_status_code` integer, nullable, required
  - `last_latency_ms` integer, nullable, required
  - `last_value` number, nullable, required
  - `last_error` string, nullable, required
  - `change_count` integer, required
  - `ping_url` string, nullable
  - `ssl_expires_at` string, date-time, nullable
  - `domain_expires_at` string, date-time, nullable
  - `security_grade` string, nullable
  - `last_indicator` string, nullable
  - `agent_id` integer, nullable
  - `slo_target` number, nullable
  - `anomaly_alerts` boolean

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/puzaricloud/apis/vigil-api.md) · [All operations](https://skmtc.dev/puzaricloud/apis/vigil-api/llms.txt) · [OpenAPI document](https://skmtc.dev/puzaricloud/apis/vigil-api/revisions/1cb93f81f1a7?raw)
