API: monitors
Create every kind of monitor, find them by tag, change, pause, check now, read results and uptime — with requests and answers.
Reading needs a read token, changing a write token. The fields are those of the monitor form in the dashboard; Monitors and conditions explains what they do.
Create a monitor
curl -sS -X POST "$HEIMDALL/monitors" \
-H "Authorization: Bearer $HEIMDALL_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "API",
"type": "http",
"target": "https://api.example.com/health",
"interval_seconds": 60,
"regions": ["ist", "fra", "stc"],
"conditions": ["[STATUS] == 200", "[RESPONSE_TIME] < 800"],
"tags": ["env:prod", "service:api"],
"severity": "critical"
}'{
"id": "01JC4Q8Z2M7V3K9X5T1R6B0WAP",
"name": "API",
"type": "http",
"target": "https://api.example.com/health",
"interval_seconds": 60,
"timeout_seconds": 10,
"regions": ["ist", "fra", "stc"],
"quorum": 2,
"fail_threshold": 2,
"recovery_threshold": 2,
"conditions": ["[STATUS] == 200", "[RESPONSE_TIME] < 800"],
"tags": ["env:prod", "service:api"],
"severity": "critical",
"state": "pending",
"config_version": 1,
"created_at": "2026-10-27T20:13:43Z",
"updated_at": "2026-10-27T20:13:43Z"
}A new monitor is pending until its first checks come in, then up, down or degraded by its quorum. The fields:
| Field | Required | What it is |
|---|---|---|
name | yes | Up to 120 characters. |
type | yes | http, keyword, tcp, icmp, dns, tls, heartbeat (table below). |
target | yes, but not for heartbeat | What is checked: a URL, host:port, a host name or an IP. |
interval_seconds | yes | How often; the least the plan allows (15 s on Business) or more, up to a day. |
regions | yes, but not for heartbeat | Where from: public regions (ist, fra, stc) and your private locations (prv-…). On a plan without region selection, leave it to the defaults. |
quorum | no | How many regions must agree that it is down; default: most of them. |
fail_threshold, recovery_threshold | no | Failed / passed checks in a row before a region changes its mind; default 2. |
timeout_seconds | no | 1–60, default 10. |
conditions | no | Up to 20, e.g. [STATUS] == 200; a check is up only when all of them pass (Monitors and conditions has the whole language). |
http | no | method, headers, body, follow_redirects (true), verify_tls (true), allow_rsa_key_exchange (false; “Old TLS servers” in Monitors and conditions). |
dns | no | record_type (A, AAAA, CNAME, MX, TXT, NS), resolver. |
tls | no | starttls: smtp for a mail server’s submission port, host:port (587; not 25 or 465), every 300 s at most (“Mail servers: STARTTLS” in Monitors and conditions). None: TLS from the first byte. |
heartbeat | no | grace_seconds: how late a ping may be — 60 to 86400; 0 or none: a fifth of the interval, at least 60. PUT replaces it: send it again to keep it. |
slow_threshold_ms | no | Slower than this is degraded. |
severity | no | critical (default), major, minor — its incidents’ severity. |
tags | no | Up to 20 key:value tags, e.g. env:prod; what scripts find monitors by. |
team_id, escalation_policy_id, depends_on | no | Whose alerts they are, which policy, which monitor it depends on (depends_on: while that one, or one it depends on, is down — at least as serious, of the same team, for an hour at most — this one’s incidents alert nobody; its alerts start if its checks still fail once that one is back. A cycle is refused with 422). |
| `type` | `target` | Conditions it knows |
|---|---|---|
http | https://api.example.com/health | [STATUS], [RESPONSE_TIME], [BODY] (and [BODY].path.to.field for JSON), [CERT_EXPIRY] |
keyword | a URL, as http | the same; the text you look for: [BODY] == pat(*Pay now*) |
tcp | db.example.com:5432 | [CONNECTED], [RESPONSE_TIME] |
icmp | 203.0.113.10 or a host name | [CONNECTED], [RESPONSE_TIME] |
dns | example.com | [DNS_RCODE], [RECORD_COUNT], [RECORDS], [IP], [RESPONSE_TIME] |
tls | example.com:443 | [CERT_EXPIRY], [CONNECTED] |
domain | example.com (the registered name; every 6–24 h) | [DOMAIN_EXPIRY] |
rbl | mail.example.com or a public IPv4 address (every 15 min – 24 h; rbl.off: lists not asked) | [LISTED_COUNT], [LISTED_ON] |
mail_auth | example.com or mail.example.com (every 5 min–24 h; mail_auth.dkim_selectors: up to 5) | [SPF_STATUS], [SPF_LOOKUPS], [SPF_ALL], [SPF], [DMARC_POLICY], [DMARC], [DKIM_MISSING], [DKIM_KEYS] |
heartbeat | — (your job calls Heimdall) | — |
The other kinds, as bodies
{
"name": "Checkout page",
"type": "keyword",
"target": "https://shop.example.com/checkout",
"interval_seconds": 60,
"regions": ["ist", "fra"],
"conditions": ["[STATUS] == 200", "[BODY] == pat(*Pay now*)"]
}{
"name": "Orders API",
"type": "http",
"target": "https://api.example.com/orders/health",
"interval_seconds": 30,
"regions": ["ist", "fra", "stc"],
"http": {
"method": "POST",
"headers": { "X-Health-Key": "a-key-for-the-health-check-only" },
"body": "{\"deep\": true}"
},
"conditions": ["[STATUS] == 200", "[BODY].status == ok", "[BODY].queue.depth < 1000"]
}{ "name": "Database", "type": "tcp", "target": "db.example.com:5432",
"interval_seconds": 60, "regions": ["ist"] }
{ "name": "Certificate", "type": "tls", "target": "example.com:443",
"interval_seconds": 3600, "regions": ["ist"], "conditions": ["[CERT_EXPIRY] > 14d"] }
{ "name": "DNS", "type": "dns", "target": "example.com", "interval_seconds": 300,
"regions": ["ist", "fra"], "dns": { "record_type": "A" },
"conditions": ["[DNS_RCODE] == NOERROR", "[IP] == 203.0.113.10"] }Heartbeat monitors
A heartbeat monitor is the other way round: nothing checks it, your job calls it. If no ping comes within the interval plus the grace, it is down; until its first ping it stays pending and alerts nobody, and heartbeat_due_at says when the next ping is due at the latest. The answer carries the address to call — keep it secret, anybody who has it can ping:
{ "name": "Nightly backup", "type": "heartbeat", "interval_seconds": 86400,
"heartbeat": { "grace_seconds": 3600 } }{
"id": "01JC4Q9A1B2C3D4E5F6G7H8J9K",
"type": "heartbeat",
"heartbeat_url": "https://heimdall.warewave.tech/hb/FuQQ9Ulq6zpD_clb1YpFI8-bc_jJGWa7zIaDXlzn4HA",
"state": "pending",
…
}curl -fsS -m 10 --retry 5 --retry-connrefused -o /dev/null "https://heimdall.warewave.tech/hb/FuQQ9Ulq6zpD_clb1YpFI8-bc_jJGWa7zIaDXlzn4HA"
# the job failed and knows it: say so, and the monitor is down at once
curl -fsS -m 10 --retry 5 --retry-connrefused -o /dev/null "https://heimdall.warewave.tech/hb/FuQQ9Ulq6zpD_clb1YpFI8-bc_jJGWa7zIaDXlzn4HA/fail"Find monitors
# every monitor with both tags; a key alone is any value of it
curl -sS "$HEIMDALL/monitors?tag=env:prod&tag=service:api" -H "Authorization: Bearer $HEIMDALL_API_TOKEN"
# by state, by team (a team's id, or none), by a word in the name or target
curl -sS "$HEIMDALL/monitors?state=down" -H "Authorization: Bearer $HEIMDALL_API_TOKEN"
curl -sS "$HEIMDALL/monitors?q=checkout" -H "Authorization: Bearer $HEIMDALL_API_TOKEN"
# the ids alone, with jq
curl -sS "$HEIMDALL/monitors?tag=service:api" -H "Authorization: Bearer $HEIMDALL_API_TOKEN" | jq -r '.[].id'The list gives each monitor’s state, its regions’ states, the quorum as 2/3, the last response time, the 30 days’ uptime and a day-by-day daily_30d. One monitor in full — every field as it was saved — is GET /monitors/{id}.
Change, pause, delete
curl -sS -X PUT "$HEIMDALL/monitors/01JC4Q8Z2M7V3K9X5T1R6B0WAP" \
-H "Authorization: Bearer $HEIMDALL_API_TOKEN" -H "Content-Type: application/json" \
-d '{
"name": "API",
"type": "http",
"target": "https://api.example.com/health",
"interval_seconds": 30,
"regions": ["ist", "fra", "stc"],
"conditions": ["[STATUS] == 200", "[RESPONSE_TIME] < 500"],
"tags": ["env:prod", "service:api"]
}'curl -sS -X POST "$HEIMDALL/monitors/01JC4Q8Z2M7V3K9X5T1R6B0WAP/pause" -H "Authorization: Bearer $HEIMDALL_API_TOKEN"
curl -sS -X POST "$HEIMDALL/monitors/01JC4Q8Z2M7V3K9X5T1R6B0WAP/resume" -H "Authorization: Bearer $HEIMDALL_API_TOKEN"
curl -sS -X DELETE "$HEIMDALL/monitors/01JC4Q8Z2M7V3K9X5T1R6B0WAP" -H "Authorization: Bearer $HEIMDALL_API_TOKEN"A paused monitor is not checked and opens no incident; its time counts as not monitored, not as downtime. For a deploy, a maintenance window is usually better: the monitor keeps being checked, alerts wait, and the uptime figure leaves the window out (API: status pages).
Check now, results, uptime
curl -sS -X POST "$HEIMDALL/monitors/01JC4Q8Z2M7V3K9X5T1R6B0WAP/test" \
-H "Authorization: Bearer $HEIMDALL_API_TOKEN" -H "Content-Type: application/json" \
-d '{"region": "fra"}'{
"monitor_id": "01JC4Q8Z2M7V3K9X5T1R6B0WAP",
"region": "fra",
"probe_id": "fra-1",
"started_at": "2026-10-27T20:20:05Z",
"duration_ms": 188,
"status": "up",
"conditions": [
{ "expr": "[STATUS] == 200", "ok": true, "actual": "200" },
{ "expr": "[RESPONSE_TIME] < 500", "ok": true, "actual": "188" }
],
"http": { "status": 200, "dns_ms": 4, "connect_ms": 31, "tls_ms": 62, "ttfb_ms": 179 }
}# the checks, newest first: by region, only the failed ones, 50 at a time
curl -sS "$HEIMDALL/monitors/01JC4Q8Z2M7V3K9X5T1R6B0WAP/results?status=failed&limit=50" \
-H "Authorization: Bearer $HEIMDALL_API_TOKEN"
# the next 50: before = started_at of the last one you have
curl -sS "$HEIMDALL/monitors/01JC4Q8Z2M7V3K9X5T1R6B0WAP/results?status=failed&limit=50&before=2026-10-27T18:02:11Z" \
-H "Authorization: Bearer $HEIMDALL_API_TOKEN"
# uptime in time: range = 24h, 7d, 30d, 90d or 365d
curl -sS "$HEIMDALL/monitors/01JC4Q8Z2M7V3K9X5T1R6B0WAP/availability?range=30d" \
-H "Authorization: Bearer $HEIMDALL_API_TOKEN" | jq '.total'{
"from": "2026-09-28T00:00:00Z",
"to": "2026-10-27T20:13:43Z",
"up_seconds": 2589012,
"down_seconds": 312,
"degraded_seconds": 0,
"maintenance_seconds": 1800,
"unmonitored_seconds": 0,
"outages": 1,
"level": "degraded"
}Uptime is up ÷ (up + down) of the monitored time — maintenance and the time it was not monitored are left out (How uptime is calculated). The answer also has the range in buckets (hours or days) and the outages with their start and end.
Regions
[
{ "id": "fra", "name": "Frankfurt", "private": false, "default": true },
{ "id": "ist", "name": "Istanbul", "private": false, "default": true },
{ "id": "stc", "name": "Stockholm", "private": false, "default": true },
{ "id": "prv-82k18wyx-office", "name": "Office", "private": true, "probes_online": 2 }
]