## GET /v1/alerts

List your account's alerts newest first. Page with limit and cursor. Every credential can read alerts, so a session can check whether the account is near a budget or out of credit.

Required permissions: read:alerts.
API key: Supported.
CLI user token: Supported.
Session token: Requires the ellipsis:api scope, and the session's permissions.ellipsis rules must allow the operation.
Higher permission levels include lower levels: read < write < delete.

### Response

```text
{
  "alerts": [
    {
      "body": str,
      "category": str,
      "created_at": str,
      "cta_label": str,
      "cta_url": str,
      "id": str,
      "severity": str,
      "title": str,
      "type": str
    }
  ],
  "has_more": bool,
  "next_cursor": str
}
```

### Python

```python
import os

from ellipsis import Ellipsis

client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])

for item in client.alerts.list():
    print(item)
```

### TypeScript

```typescript
import { Ellipsis } from '@ellipsis-dev/sdk';

const client = new Ellipsis({
  apiKey: process.env.ELLIPSIS_API_TOKEN!,
});

for await (const item of await client.alerts.list()) {
  console.log(item);
}
```

### cURL

```bash
curl "https://api.ellipsis.dev/v1/alerts" \
  -H "Authorization: Bearer $ELLIPSIS_API_TOKEN"
```

### Response schema

```json
{
  "properties": {
    "alerts": {
      "items": {
        "properties": {
          "body": {
            "type": "string"
          },
          "category": {
            "enum": [
              "billing",
              "agents"
            ],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "cta_label": {
            "type": "string"
          },
          "cta_url": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "severity": {
            "enum": [
              "info",
              "warning"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "enum": [
              "budget_threshold",
              "budget_blocked",
              "credit_low",
              "credit_exhausted",
              "agent_config_broken",
              "agent_failing"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "created_at",
          "category",
          "type",
          "severity",
          "title",
          "body",
          "cta_url",
          "cta_label"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "has_more": {
      "default": false,
      "type": "boolean"
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "alerts"
  ],
  "type": "object"
}
```
