# List a rule's alerts

Returns a rule's alerts, one page at a time.

```http
GET https://api.pozy.ai/v1/ads/rules/{ruleId}/alerts
```

- Area: Ads / Ad Rules
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `ruleId` (string, required)

## Query parameters

- `state` (string): one of pending, open, resolved
- `limit` (integer)
- `cursor` (string)

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/ads/rules/6cd4059483de62b474d02fe7/alerts?limit=50" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/ads/rules/6cd4059483de62b474d02fe7/alerts?limit=50", {
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.get(
    "https://api.pozy.ai/v1/ads/rules/6cd4059483de62b474d02fe7/alerts",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    params={
        "limit": 50,
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `alerts`, array of object, required
  - `id`, string, required
  - `objectId`, string, required
  - `state`, string, required: One of `pending`, `open`, `resolved`
  - `severity`, string, required: One of `warning`, `critical`. Can be null
  - `consecutiveMatches`, integer, required
  - `openedAt`, string (date-time), required: Can be null
  - `lastMatchedAt`, string (date-time), required
  - `resolvedAt`, string (date-time), required: Can be null
  - `resolvedReason`, string, required: One of `condition_cleared`, `action_applied`, `not_evaluated`, `automation_changed`, `automation_off`. Can be null
- `nextCursor`, string, required: Can be null

```json
{
  "alerts": [
    {
      "id": "6bfebd43ddc270f6d2c56fc5",
      "objectId": "6cd1b53a19a7e157d2d46b68",
      "state": "pending",
      "severity": "warning",
      "consecutiveMatches": 1,
      "openedAt": "2026-10-02T09:00:00.000Z",
      "lastMatchedAt": "2026-10-02T09:00:00.000Z",
      "resolvedAt": "2026-10-02T09:00:00.000Z",
      "resolvedReason": "condition_cleared"
    }
  ],
  "nextCursor": "string"
}
```
