Alerts API
GET /api/v1/alert-rules
Section titled “GET /api/v1/alert-rules”List Rules
Responses
| Status | Description | Schema |
|---|---|---|
| 200 | Successful Response | any |
POST /api/v1/alert-rules
Section titled “POST /api/v1/alert-rules”Create Rule
Request body (required), application/json, AlertRuleIn
| Field | Type | Required | Description |
|---|---|---|---|
channel_ids | integer[] | null | no | |
duration_s | integer | no | |
enabled | boolean | no | |
metric | string | yes | |
name | string | yes | |
operator | string | no | |
severity | string | no | |
target_id | integer | null | no | |
target_type | string | no | |
threshold | number | no |
Responses
| Status | Description | Schema |
|---|---|---|
| 201 | Successful Response | any |
| 422 | Validation Error | HTTPValidationError |
DELETE /api/v1/alert-rules/{rule_id}
Section titled “DELETE /api/v1/alert-rules/{rule_id}”Delete Rule
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
rule_id | path | integer | yes |
Responses
| Status | Description | Schema |
|---|---|---|
| 204 | Successful Response | |
| 422 | Validation Error | HTTPValidationError |
PATCH /api/v1/alert-rules/{rule_id}
Section titled “PATCH /api/v1/alert-rules/{rule_id}”Patch Rule
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
rule_id | path | integer | yes |
Request body (required), application/json, AlertRulePatch
| Field | Type | Required | Description |
|---|---|---|---|
channel_ids | integer[] | null | no | |
duration_s | integer | null | no | |
enabled | boolean | null | no | |
metric | string | null | no | |
name | string | null | no | |
operator | string | null | no | |
severity | string | null | no | |
target_id | integer | null | no | |
target_type | string | null | no | |
threshold | number | null | no |
Responses
| Status | Description | Schema |
|---|---|---|
| 200 | Successful Response | any |
| 422 | Validation Error | HTTPValidationError |
GET /api/v1/alert-rules/metrics
Section titled “GET /api/v1/alert-rules/metrics”List Metrics
One source of truth for the metric enum: the rule form renders this.
Responses
| Status | Description | Schema |
|---|---|---|
| 200 | Successful Response | any |
GET /api/v1/alerts
Section titled “GET /api/v1/alerts”List Alerts
Doc 05 leaves the entitlement column blank here on purpose: the sidebar health footer (“3 nodes · 0 alerts”) reads this on every tier.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
state | query | string | null | no | |
limit | query | integer | no |
Responses
| Status | Description | Schema |
|---|---|---|
| 200 | Successful Response | any |
| 422 | Validation Error | HTTPValidationError |
POST /api/v1/alerts/{alert_id}/ack
Section titled “POST /api/v1/alerts/{alert_id}/ack”Ack Alert
Acknowledging silences; it never resolves. The evaluator still flips an
acked alert to resolved on recovery (services/alerts.py); an operator
saying “I know” must not make the system stop tracking whether it is fixed.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
alert_id | path | integer | yes |
Responses
| Status | Description | Schema |
|---|---|---|
| 200 | Successful Response | any |
| 422 | Validation Error | HTTPValidationError |