Alert rules

An alert rule ties one monitor to one alert channel, and controls which events (down, recovery, degraded) trigger a notification. A single monitor can have multiple rules — one per channel.

Auth: Bearer token

List rules

GET /alerts/rules

Query parameters

monitor_idstringquery

Filter rules for a specific monitor.

Request

bash
curl -H "Authorization: Bearer hu_..." \ "https://happyuptime.com/api/v1/alerts/rules?monitor_id=mon_abc123"

Response

json
{ "data": [ { "id": "rule_001", "monitor_id": "mon_abc123", "alert_channel_id": "ch_001", "on_down": true, "on_recovery": true, "on_degraded": false, "created_at": "2026-03-01T10:00:00Z" } ]}

Create a rule

POST /alerts/rules

Scope: write

Body parameters

monitor_idstringrequiredbody

Monitor ID.

alert_channel_idstringrequiredbody

Alert channel ID.

on_downbooleanbodydefault: true

Alert when monitor goes down.

on_recoverybooleanbodydefault: true

Alert when monitor recovers.

on_degradedbooleanbodydefault: false

Alert when monitor degrades (some regions down, not all).

Request

bash
curl -X POST -H "Authorization: Bearer hu_..." \ -H "Content-Type: application/json" \ -d '{ "monitor_id": "mon_abc123", "alert_channel_id": "ch_001", "on_down": true, "on_recovery": true, "on_degraded": true }' \ "https://happyuptime.com/api/v1/alerts/rules"

Response

json
{ "data": { "id": "rule_002", "monitor_id": "mon_abc123", "alert_channel_id": "ch_001", "on_down": true, "on_recovery": true, "on_degraded": true, "created_at": "2026-03-07T16:00:00Z" }}

Delete a rule

DELETE /alerts/rules/:id

Scope: write

bash
curl -X DELETE -H "Authorization: Bearer hu_..." \ "https://happyuptime.com/api/v1/alerts/rules/rule_002"
json
{ "data": { "id": "rule_002", "deleted": true }}

New monitors are automatically linked to any alert channels marked as is_default: true. Override this behavior per-monitor by deleting the auto-created rule or adding your own.