Alerts API
Manage alerts and alert rules.
List Alerts
http
GET /api/v1/alertsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status (firing, resolved, silenced) |
severity | string | Filter by severity (critical, warning, info) |
service | string | Filter by service |
Response
json
{
"data": [
{
"id": "alt_abc123",
"name": "High CPU Usage",
"status": "firing",
"severity": "warning",
"service": "api-gateway",
"message": "CPU usage is 92%",
"started_at": "2025-01-15T10:00:00Z"
}
]
}Get Alert
http
GET /api/v1/alerts/:idAcknowledge Alert
http
POST /api/v1/alerts/:id/acknowledgejson
{
"comment": "Investigating the issue"
}Resolve Alert
http
POST /api/v1/alerts/:id/resolveList Alert Rules
http
GET /api/v1/alert-rulesCreate Alert Rule
http
POST /api/v1/alert-rulesRequest Body
json
{
"name": "High CPU Alert",
"condition": "cpu_percent > 80",
"duration": "5m",
"severity": "warning",
"services": ["api-gateway", "auth-service"],
"notifications": ["slack", "email"]
}Silence Alerts
http
POST /api/v1/alerts/silencejson
{
"matcher": {
"service": "api-gateway"
},
"duration": "2h",
"reason": "Planned maintenance"
}