> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anomalyarmor.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List Alerts

> List triggered alerts with filtering by status, type, and date range

<div aria-hidden="true" style={{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap"}}>For LLM agents: documentation index at <a href="/llms.txt" tabIndex={-1}>/llms.txt</a>, full text at <a href="/llms-full.txt" tabIndex={-1}>/llms-full.txt</a>. Append .md to any page URL for plain markdown.</div>

Retrieve alerts that have been triggered. Use this to build dashboards, integrate with ticketing systems, or create custom notification workflows.

## When to Use

* **Dashboard integration**: Show recent alerts in monitoring tools
* **Ticketing sync**: Create tickets for triggered alerts
* **Reporting**: Generate alert volume and response metrics
* **Custom workflows**: Build automated response systems

## SDK & CLI Examples

<CodeGroup>
  ```python Python SDK theme={null}
  from anomalyarmor import Client

  client = Client(api_key="aa_live_xxx")

  # Get recent unacknowledged alerts
  alerts = client.alerts.list(status="triggered", limit=20)

  for alert in alerts:
      print(f"{alert.rule_name}: {alert.message}")
      print(f"  Asset: {alert.asset}")
      print(f"  Triggered: {alert.triggered_at}")

  # Filter by alert type
  schema_alerts = client.alerts.list(event_type="schema_change")

  # Filter by date range
  from datetime import datetime, timedelta
  yesterday = datetime.now() - timedelta(days=1)
  alerts = client.alerts.list(since=yesterday)
  ```

  ```bash CLI theme={null}
  # List recent alerts
  anomalyarmor alerts list

  # Filter by status
  anomalyarmor alerts list --status triggered

  # Filter by event type
  anomalyarmor alerts list --type schema_change

  # Output as JSON
  anomalyarmor alerts list --format json
  ```
</CodeGroup>

## Parameters

| Parameter    | Type     | Description                                                                |
| ------------ | -------- | -------------------------------------------------------------------------- |
| `status`     | string   | Filter by status: `triggered`, `acknowledged`, `resolved`                  |
| `event_type` | string   | Filter by type: `schema_change`, `freshness_violation`, `discovery_failed` |
| `asset`      | string   | Filter by asset qualified name                                             |
| `since`      | datetime | Only alerts after this timestamp                                           |
| `until`      | datetime | Only alerts before this timestamp                                          |
| `limit`      | integer  | Max results (default: 100, max: 1000)                                      |
| `offset`     | integer  | Skip first N results                                                       |

## Response

```json theme={null}
{
  "alerts": [
    {
      "id": "alt_abc123",
      "rule_name": "Production Schema Changes",
      "event_type": "schema_change",
      "status": "triggered",
      "message": "Column 'status' removed from orders table",
      "asset": "snowflake.prod.public.orders",
      "details": {
        "change_type": "column_removed",
        "column_name": "status",
        "column_type": "varchar(20)"
      },
      "triggered_at": "2024-01-15T08:30:00Z",
      "acknowledged_at": null,
      "resolved_at": null,
      "destinations": ["slack", "pagerduty"]
    }
  ],
  "total": 45,
  "limit": 100,
  "offset": 0
}
```

## Response Fields

| Field             | Description                                  |
| ----------------- | -------------------------------------------- |
| `id`              | Unique alert identifier                      |
| `rule_name`       | Name of the rule that triggered              |
| `event_type`      | Type of event that triggered the alert       |
| `status`          | `triggered`, `acknowledged`, or `resolved`   |
| `message`         | Human-readable alert description             |
| `asset`           | Affected asset qualified name                |
| `details`         | Event-specific details (varies by type)      |
| `triggered_at`    | When the alert fired                         |
| `acknowledged_at` | When someone acknowledged it (if applicable) |
| `resolved_at`     | When the alert was resolved (if applicable)  |
| `destinations`    | Where the alert was sent                     |

## Status Values

| Status         | Meaning                           |
| -------------- | --------------------------------- |
| `triggered`    | Alert fired, not yet acknowledged |
| `acknowledged` | Someone is looking at it          |
| `resolved`     | Issue has been addressed          |

## Event Types

| Type                  | Description                       |
| --------------------- | --------------------------------- |
| `schema_change`       | Table or column structure changed |
| `freshness_violation` | Data older than SLA threshold     |
| `discovery_failed`    | Discovery job couldn't complete   |
| `asset_removed`       | Table or view no longer exists    |

## Error Responses

| Status | Meaning                    |
| ------ | -------------------------- |
| `401`  | Invalid or missing API key |
| `400`  | Invalid filter parameters  |
| `429`  | Rate limit exceeded        |
