Alerts API
Configure and manage alerting rules.
Alerts API
Endpoints for managing alert rules and viewing alert history.
GET /alerts
List all alert rules for a project.
Request
Response (200 OK)
POST /alerts
Create a new alert rule.
Request
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
projectId | string | ✓ | Project ID |
name | string | ✓ | Alert name |
condition.level | string | ✓ | Log level to match |
condition.threshold | number | ✓ | Number of logs to trigger |
condition.window | string | ✓ | Time window (e.g., 5m, 1h) |
condition.source | string | Filter by source | |
condition.pattern | string | Regex pattern for message | |
channels | array | ✓ | Notification channels: email, push |
cooldown | string | Minimum time between alerts (default: 15m) |
Response (201 Created)
PUT /alerts/:id
Update an alert rule.
Request
Response (200 OK)
DELETE /alerts/:id
Delete an alert rule.
Request
Response (204 No Content)
No response body.
GET /alerts/:id/history
Get alert trigger history.
Request
Response (200 OK)
Alert Conditions
Level-based
Trigger when logs of a specific level exceed threshold:
Pattern-based
Trigger when log messages match a regex pattern:
Source-filtered
Trigger only for logs from a specific source:
Cooldown prevents alert fatigue by limiting how often an alert can fire.
Alert Limits
| Plan | Max Alerts per Project |
|---|---|
| Free | 2 |
| Starter | 10 |
| Pro | 50 |
| Enterprise | Unlimited |