Set alert rule

Create or update an alert rule on an application. metric "down" fires when the app is not running (threshold is 1); "restart_loop" fires when restarts grow past threshold within the window; "memory_pct" fires when memory stays above threshold percent of its cgroup limit for the window. duration_minutes (1-60) is the consecutive-minutes window. An open rule fires once and closes with a note when the condition clears. Pass rule_id to update an existing rule. Requires deploy scope. Since 25 September 2026 the metrics also include "cpu_pct" (percent 1-10000, 100 = one full core, evaluated on the report against the sample-weighted bucket average), "agent_offline" and "backup_failed" (both threshold 1, evaluated by the platform's minute cron tick with a daily fallback — an offline agent cannot report itself). The failover metrics "standby_stale" and "drill_failed" ride the pair of a standby (its primary application): standby_stale fires when the pair's scheduled sync is at least max(30, duration_minutes) minutes past due and no drill is running (threshold is 1); drill_failed fires while the pair's latest finished drill ended failed, closing when a later drill verifies (threshold is 1). Both are created automatically, enabled, on the pair's first verified sync; evidence carries only state, ages and closed failure codes — never a location, address or app data; with failover disabled they resolve and never open.

post/platform/deployments/custom/{deployment_id}/alert-rules

Request

  • Base URL: https://api.imprezahost.com/v1
  • URL: https://api.imprezahost.com/v1/platform/deployments/custom/{deployment_id}/alert-rules
  • Auth: API key in header X-API-Key and API key in header X-API-Secret

Path parameters

deployment_idstring required

The application (dpl_...).

Request body

rule_idstring

Existing rule to update (arl_...). Omit to create.

metric'down' | 'restart_loop' | 'memory_pct' | 'cpu_pct' | 'agent_offline' | 'backup_failed' | 'ingress_not_enforced' | 'uptime' | 'shield_blocked' | 'shield_rate_limited' | 'standby_stale' | 'drill_failed' required
thresholdnumber required

1 for down, agent_offline, backup_failed, ingress_not_enforced, uptime, standby_stale and drill_failed; restart count for restart_loop; percent 1-100 for memory_pct; percent 1-10000 for cpu_pct (100 = one full core).

duration_minutesnumber

Consecutive minutes the condition must hold (1-60, default 3). Shield spike metrics use five UTC minute buckets: duration_minutes must be 5 (default 5); integer threshold 1-1000000 is exceeded by distinct blocked or rate-limited request counts. No visitor identity is recorded.

enabledboolean

Default true.

Response

API response envelope. For apply operations acceptance is queued, not verified completion.

Changes

No recorded changes to this operation across all 1 revision of this API.