Monitors
Uptime monitor types (HTTP, keyword, JSON, TCP, DNS, SSL, heartbeat), configuration fields, regions and how down is decided.
Monitors check things from outside your infrastructure, from Cloudflare’s network.
Common fields
| Field | Description |
|---|---|
name | Display name. |
type | http, keyword, json, tcp, dns, ssl or heartbeat. |
target | URL, host:port or hostname depending on type. Generated for heartbeats. |
interval_sec | How often to check. Minimum: Free 300s, Pro 60s, Business 60s. |
timeout_ms | Request timeout, default 10000. |
regions | Array of region IDs (below). Limited by plan. |
channel_ids | Recipients to notify. |
config | Type-specific options. |
Types
http
Requests a URL and checks the status code.
config.method— GET (default), POST, PUT, PATCH, DELETE, HEADconfig.headers— object of request headersconfig.body— request body stringconfig.expected_status— e.g."200-299"(default),"200","200-399"config.follow_redirects— default true
keyword
An HTTP check that also searches the response body.
config.keyword— exact, case-sensitive textconfig.keyword_mode—"contains"(default; fails if missing) or"absent"(fails if present)
json
An HTTP check that parses the response as JSON and compares a value.
config.json_path— dot path, e.g."status.db"or"checks.0.ok"config.json_expected— value to compare (as a string)
tcp
Opens a TCP connection to target in host:port form and measures connect time.
dns
Resolves target via DNS-over-HTTPS.
config.record_type— A (default), AAAA, CNAME, MX, TXT, NSconfig.expected— optional; fails unless an answer contains this string
ssl
Checks the TLS certificate on target (hostname, optionally host:port).
config.days_warning— fail when fewer days remain (default 14)
heartbeat
Passive: your job pings Statance. See Heartbeats.
Regions
| ID | Region |
|---|---|
wnam | US West |
enam | US East |
weur | Western Europe |
eeur | Eastern Europe |
apac | Asia Pacific |
oc | Oceania |
When is a monitor down?
With several regions, a monitor is marked down when a majority of its regions fail in the same round. With one region, a failed check is retried once automatically before it counts. When the monitor goes down an incident opens and recipients are notified; when it recovers, the incident is resolved and a recovery alert is sent.
Example
curl -X POST https://api.statance.com/v1/monitors \
-H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"Marketing site","type":"keyword","target":"https://example.com",
"interval_sec":60,"regions":["enam","weur","apac"],
"config":{"keyword":"Sign up","keyword_mode":"contains"}}'Next: Alert rules →