Alerts API
Configure alert rules and manage alert events and notifications.
Alert Rules
Alert rules define conditions that trigger notifications. When a log entry matches a rule's conditions, an alert event is created and notifications are sent via configured channels.
Create Alert Rule
/api/v1/alert-rulesCreate a new alert rule
curl -X POST "https://apperioserver.onrender.com/api/v1/alert-rules" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "High Error Rate Alert",
"projectId": "proj_abc123",
"enabled": true,
"conditions": {
"level": "error",
"threshold": 10,
"timeWindow": "5m",
"operator": "greaterThan"
},
"channels": {
"email": true,
"slack": true,
"webhook": false
},
"cooldownMinutes": 15
}'// Response(201 Created)
{
"status": "success",
"data": {
"id": "rule_xyz789",
"name": "High Error Rate Alert",
"projectId": "proj_abc123",
"enabled": true,
"conditions": {
"level": "error",
"threshold": 10,
"timeWindow": "5m",
"operator": "greaterThan"
},
"channels": {
"email": true,
"slack": true,
"webhook": false
},
"cooldownMinutes": 15,
"lastTriggered": null,
"createdAt": "2026-03-07T10:30:00Z"
}
}List Alert Rules
/api/v1/alert-rules/:projectIdGet all alert rules for a project
curl "https://apperioserver.onrender.com/api/v1/alert-rules/proj_abc123" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Update Alert Rule
/api/v1/alert-rules/:idUpdate an existing alert rule
curl -X PUT "https://apperioserver.onrender.com/api/v1/alert-rules/RULE_ID" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": false,
"cooldownMinutes": 30
}'Delete Alert Rule
/api/v1/alert-rules/:idDelete an alert rule
Alert Events
Alert events are created when log data matches a rule's conditions. Each event records when the alert fired, what triggered it, and its current status.
/api/v1/alerts/:projectIdGet alert events for a project
// Response
{
"status": "success",
"data": [
{
"id": "alert_001",
"ruleId": "rule_xyz789",
"ruleName": "High Error Rate Alert",
"projectId": "proj_abc123",
"status": "active",
"triggeredAt": "2026-03-07T10:35:00Z",
"triggerData": {
"errorCount": 15,
"timeWindow": "5m",
"threshold": 10
},
"acknowledgedAt": null,
"resolvedAt": null
}
]
}/api/v1/alerts/statsGet alert statistics across all projects
Manage Alert Events
Acknowledge Alert
/api/v1/alerts/:alertId/acknowledgeAcknowledge an active alert
Update Alert Status
/api/v1/alerts/:alertId/statusUpdate alert status (active, acknowledged, resolved)
// Request body
{
"status": "resolved"
}Bulk Update
/api/v1/alerts/bulk-updateUpdate multiple alerts at once
// Request body
{
"alertIds": ["alert_001", "alert_002", "alert_003"],
"status": "resolved"
}Auto-Resolve
/api/v1/alerts/auto-resolveAuto-resolve alerts older than a specified time
Notification Channels
Alert rules can notify through multiple channels:
| Channel | Configuration | Details |
|---|---|---|
| Automatic (uses account email) | Sends email to project owner and admins | |
| Slack | Webhook URL in project settings | Posts to configured Slack channel |
| Webhook | Custom URL in project settings | Sends POST request with alert payload |
Configure notification channels via the project integration settings:
/api/v1/projects/:projectId/integration-settingsUpdate Slack/webhook integration URLs
// Request body
{
"slackWebhookUrl": "https://hooks.slack.com/services/T.../B.../...",
"webhookUrl": "https://your-app.com/api/apperio-webhook"
}Tip
cooldownMinutes setting to prevent notification flooding. After an alert fires, the same rule will not trigger again until the cooldown period expires.