```yaml
product: AlterLab
title: Alerts API Reference
category: api
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
source_url: https://alterlab.io/docs/api/generated/alerts
```

# Alerts API Reference

Auto-generated API reference for alerts endpoints, built from the OpenAPI spec.

## GET /api/v1/alerts/history

List Alert History
List alert history for the current organization.

Authentication: `Authorization: Bearer <session token>`

| Parameter | In | Type | Required | Description |
|-----------|----|------|----------|-------------|
| `rule_id` | query | `string` | no | Filter by alert rule ID |
| `alert_type` | query | `"credit_threshold" \| "domain_failure_rate" \| "job_consecutive_failures" \| "response_time_spike" \| "daily_failure_count" \| "schedule_failure" \| "product_failure_rate" \| "product_cost_spike" \| "product_run_stuck" \| "recurring_run_auto_paused" \| "map_urls_changed"` | no | Filter by alert type |
| `limit` | query | `integer` | no |  |
| `offset` | query | `integer` | no |  |
| `X-Organization-Id` | header | `string` | no |  |

## GET /api/v1/alerts/rules

List Alert Rules
List all alert rules for the current organization.

Authentication: `Authorization: Bearer <session token>`

| Parameter | In | Type | Required | Description |
|-----------|----|------|----------|-------------|
| `alert_type` | query | `"credit_threshold" \| "domain_failure_rate" \| "job_consecutive_failures" \| "response_time_spike" \| "daily_failure_count" \| "schedule_failure" \| "product_failure_rate" \| "product_cost_spike" \| "product_run_stuck" \| "recurring_run_auto_paused" \| "map_urls_changed"` | no | Filter by alert type |
| `include_inactive` | query | `boolean` | no | Include disabled rules |
| `X-Organization-Id` | header | `string` | no |  |

## POST /api/v1/alerts/rules

Create Alert Rule
Create a new alert rule.

Authentication: `Authorization: Bearer <session token>`

| Parameter | In | Type | Required | Description |
|-----------|----|------|----------|-------------|
| `X-Organization-Id` | header | `string` | no |  |
| `name` | body | `string` | yes | Human-readable name |
| `alert_type` | body | `"credit_threshold" \| "domain_failure_rate" \| "job_consecutive_failures" \| "response_time_spike" \| "daily_failure_count" \| "schedule_failure" \| "product_failure_rate" \| "product_cost_spike" \| "product_run_stuck" \| "recurring_run_auto_paused" \| "map_urls_changed"` | yes | Supported alert types. |
| `conditions` | body | `object` | yes | Conditions for the alert (varies by alert_type) |
| `domain_filter` | body | `string[]` | no |  |
| `channels` | body | `object` | no | Delivery channels: {email: bool, webhook_id: str, slack_webhook_url: str} |
| `cooldown_minutes` | body | `integer` | no | Minutes to wait before re-alerting (5 min to 24 hours) |

## DELETE /api/v1/alerts/rules/{rule_id}

Delete Alert Rule
Delete an alert rule and its history.

Authentication: `Authorization: Bearer <session token>`

| Parameter | In | Type | Required | Description |
|-----------|----|------|----------|-------------|
| `rule_id` | path | `string` | yes | Alert rule ID |
| `X-Organization-Id` | header | `string` | no |  |

## GET /api/v1/alerts/rules/{rule_id}

Get Alert Rule
Get a single alert rule by ID.

Authentication: `Authorization: Bearer <session token>`

| Parameter | In | Type | Required | Description |
|-----------|----|------|----------|-------------|
| `rule_id` | path | `string` | yes | Alert rule ID |
| `X-Organization-Id` | header | `string` | no |  |

## PATCH /api/v1/alerts/rules/{rule_id}

Update Alert Rule
Update an alert rule.

Authentication: `Authorization: Bearer <session token>`

| Parameter | In | Type | Required | Description |
|-----------|----|------|----------|-------------|
| `rule_id` | path | `string` | yes | Alert rule ID |
| `X-Organization-Id` | header | `string` | no |  |
| `name` | body | `string` | no |  |
| `conditions` | body | `object` | no |  |
| `domain_filter` | body | `string[]` | no |  |
| `channels` | body | `object` | no |  |
| `cooldown_minutes` | body | `integer` | no |  |
| `is_active` | body | `boolean` | no |  |

## POST /api/v1/alerts/rules/{rule_id}/test

Test Fire Alert Rule
Send a test alert through the rule's channels. Records no history and does not touch ``last_triggered_at``, so the rule's cooldown is unaffected.

Authentication: `Authorization: Bearer <session token>`

| Parameter | In | Type | Required | Description |
|-----------|----|------|----------|-------------|
| `rule_id` | path | `string` | yes | Alert rule ID |
| `X-Organization-Id` | header | `string` | no |  |
