- viewer / editor / admin can list and read
- editor / admin can create, update, and delete
GET /api/v1/alerts
List all alert rules for the tenant.Response
POST /api/v1/alerts
Create a new alert rule. Editor or Admin.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Alert rule name |
metric | string | Yes | See Supported metrics |
operator | string | Yes | gt, lt, gte, lte, eq |
threshold | number | Yes | Threshold value to compare against |
windowMinutes | number | No | Observation window (default: 5) |
channels | array | Yes | Destinations — see Channel shapes |
cooldownMinutes | number | No | Min time between consecutive fires (default: 60) |
enabled | boolean | No | Whether the rule is active (default: true) |
Supported metrics
| Metric | Unit | Description |
|---|---|---|
acceptance_rate | 0–1 | Positive outcomes / impressions |
ctr | 0–1 | Clicks / impressions |
revenue | currency units | Sum of conversion values |
selection_frequency | 0–1 | Decisions with ≥1 selected offer / total traces |
latency_p99 | milliseconds | p99 of decision latency |
degraded_scoring_rate | 0–1 | Traces with degradedScoring=true / total |
Channel shapes
Thechannels array accepts three shapes (mix and match allowed):
POST /api/v1/notifications/providers.
Example
Response (201)
Returns the created alert rule.GET /api/v1/alerts/:id
Get a single alert rule by ID.PUT /api/v1/alerts/:id
Update an existing alert rule. All fields are optional. Editor or Admin.DELETE /api/v1/alerts/:id
Delete an alert rule. Editor or Admin. Returns204 No Content.
Rule lifecycle status
Thestatus field reflects the outcome of the most recent evaluation:
| Status | Meaning |
|---|---|
ok | Last evaluation did not trigger |
fired | Last evaluation triggered and at least one destination accepted dispatch |
cooldown | Triggered, but still inside cooldownMinutes since lastFiredAt |
delivery_failed | Triggered, but every destination returned a failure |
unsupported_metric | metric is not recognized by the evaluator |
/api/cron/tick entry point.