API Reference
Auto-generated
Alerts
API reference for alerts endpoints.
Auto-generated
This page was generated from the OpenAPI spec. Run
make generate-docs to refresh after spec changes.GET /api/v1/alerts/history
GET
/api/v1/alerts/historyList Alert History
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| rule_id | string | Optional | Filter by alert rule ID |
| alert_type | "credit_threshold" | "domain_failure_rate" | "job_consecutive_failures" | "response_time_spike" | "daily_failure_count" | "schedule_failure" | Optional | Filter by alert type |
| limit | integer | Optional | limitDefault: 50 |
| offset | integer | Optional | offsetDefault: 0 |
| X-Organization-Id | string | Optional | X-Organization-Id |
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/alerts/history \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"alerts": [],
"total": 0
}GET /api/v1/alerts/rules
GET
/api/v1/alerts/rulesList Alert Rules
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| alert_type | "credit_threshold" | "domain_failure_rate" | "job_consecutive_failures" | "response_time_spike" | "daily_failure_count" | "schedule_failure" | Optional | Filter by alert type |
| include_inactive | boolean | Optional | Include disabled rulesDefault: False |
| X-Organization-Id | string | Optional | X-Organization-Id |
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/alerts/rules \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"rules": [],
"total": 0
}POST /api/v1/alerts/rules
POST
/api/v1/alerts/rulesCreate Alert Rule
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| X-Organization-Id | string | Optional | X-Organization-Id |
| name | string | Required | Human-readable name |
| alert_type | "credit_threshold" | "domain_failure_rate" | "job_consecutive_failures" | "response_time_spike" | "daily_failure_count" | "schedule_failure" | Required | Supported alert types. |
| conditions | object | Required | Conditions for the alert (varies by alert_type) |
| domain_filter | string[] | Optional | domain_filter |
| channels | object | Optional | Delivery channels: {{email: bool, webhook_id: str}}Default: {{'email': True}} |
| cooldown_minutes | integer | Optional | Minutes to wait before re-alerting (5 min to 24 hours)Default: 60 |
Request Example
Bash
curl -X POST https://api.alterlab.io/api/v1/alerts/rules \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "example_name",
"alert_type": "...",
"conditions": "...",
"channels": "..."
}'Response Example
JSON
{
"status": "ok"
}GET /api/v1/alerts/rules/{rule_id}
GET
/api/v1/alerts/rules/{rule_id}Get Alert Rule
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| rule_id | string | Required | Alert rule ID |
| X-Organization-Id | string | Optional | X-Organization-Id |
Request Example
Bash
curl -X GET https://api.alterlab.io/api/v1/alerts/rules/<rule_id> \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"id": "example",
"organization_id": "example",
"name": "example",
"alert_type": "example",
"conditions": {},
"domain_filter": "example"
}PATCH /api/v1/alerts/rules/{rule_id}
PATCH
/api/v1/alerts/rules/{rule_id}Update Alert Rule
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| rule_id | string | Required | Alert rule ID |
| X-Organization-Id | string | Optional | X-Organization-Id |
| name | string | Optional | name |
| conditions | object | Optional | conditions |
| domain_filter | string[] | Optional | domain_filter |
| channels | object | Optional | channels |
| cooldown_minutes | integer | Optional | cooldown_minutes |
| is_active | boolean | Optional | is_active |
Request Example
Bash
curl -X PATCH https://api.alterlab.io/api/v1/alerts/rules/<rule_id> \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"id": "example",
"organization_id": "example",
"name": "example",
"alert_type": "example",
"conditions": {},
"domain_filter": "example"
}DELETE /api/v1/alerts/rules/{rule_id}
DELETE
/api/v1/alerts/rules/{rule_id}Delete Alert Rule
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| rule_id | string | Required | Alert rule ID |
| X-Organization-Id | string | Optional | X-Organization-Id |
Request Example
Bash
curl -X DELETE https://api.alterlab.io/api/v1/alerts/rules/<rule_id> \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"Response Example
JSON
{
"status": "ok"
}