Alert Policies
Overview
WEDA's monitoring workflow has two parts that work together:
- Alert Policy — evaluates incoming values from one or more DataStreams against trigger and reset conditions
- Notification Channel — defines how an alert message is delivered, such as by email, Teams, LINE, or webhook
An Alert Policy is an independent, Org-level resource — unlike the DataStream it monitors, it isn't owned by any single device. Attach it to one or more DataStreams (at any layer: a raw device stream or an Analyzer's output) via a dedicated attach/detach call. See Notification Channels to configure delivery endpoints first.
An Alert Policy monitors the value of every DataStream attached to it. WEDA evaluates the policy whenever new telemetry arrives on any attached DataStream.
Each policy has these evaluation parameters:
| Parameter | Description |
|---|---|
alertLevel | A comparison expression that defines when an alert is triggered, such as >=75 |
alertResetLevel | A comparison expression that defines when the value has returned to its normal range, such as <70 |
delay | Debounce window in seconds. A condition must hold for this long before it takes effect. Optional, defaults to 0 (no debounce) |
The delay applies to both directions. A trigger condition must hold for the delay before an alert
fires, and the reset condition must hold for the delay before the alert is resolved. With the
default 0, both take effect immediately.
Supported conditions
alertLevel and alertResetLevel are threshold expressions evaluated against the incoming
DataStream value. Both are required, and both carry the comparison operator inside the string
itself — for example alertLevel: ">=70" with alertResetLevel: "<65".
The API declares these two fields as free-form strings and documents them by example. It does not
publish the full grammar — which operators are accepted, and whether anything beyond a single
comparison works. Stay with the documented >=70 / <65 form unless RD confirms otherwise.
Operations
| Operation | API | Description |
|---|---|---|
| Create Alert Policy | POST /api/v1/orgs/{orgId}/alert-policies | Define a new policy |
| List Alert Policies | GET /api/v1/orgs/{orgId}/alert-policies | List policies in the Org (filter by dataStreamId to find policies attached to a specific DataStream) |
| Get Alert Policy | GET /api/v1/orgs/{orgId}/alert-policies/{alertPolicyId} | Get one policy by ID |
| Update Alert Policy | PATCH /api/v1/orgs/{orgId}/alert-policies/{alertPolicyId} | Update the policy or its notification settings |
| Delete Alert Policy | DELETE /api/v1/orgs/{orgId}/alert-policies/{alertPolicyId} | Remove a policy (must be disabled first) |
| Enable / Disable | POST /api/v1/orgs/{orgId}/alert-policies/{alertPolicyId}:{action} | Enable or disable a policy without deleting it |
| List Attached DataStreams | GET /api/v1/orgs/{orgId}/alert-policies/{alertPolicyId}/data-streams | DataStreams currently attached |
| Set Attached DataStreams | PUT /api/v1/orgs/{orgId}/alert-policies/{alertPolicyId}/data-streams | Replace the full attachment set |
| List Alert Events | GET /api/v1/orgs/{orgId}/alert-events | Query fired alert history |