Alert rules

Link monitors to alert channels and control which events fire notifications.

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_id string

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_id string required

Monitor ID.

alert_channel_id string required

Alert channel ID.

on_down boolean default: true

Alert when monitor goes down.

on_recovery boolean default: true

Alert when monitor recovers.

on_degraded boolean default: 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.

Ask a question... ⌘I