# Events

Source: https://docs.simail.ai/api/events/

> GET /v0/events, GET /v0/inboxes/{inbox_id}/events and the WebSocket endpoint — parameters, responses and errors.

Payloads and types: [Event types](/event-types/). How to poll reliably: [Polling events](/events/).

## List events

`GET /v0/events`

Permission `event_read`.

| Query parameter | Notes |
|---|---|
| `after` | cursor from `next_cursor`; omit to start from the oldest retained event |
| `types` | comma-separated event types |
| `inbox_ids` | comma-separated inbox IDs within your scope |
| `limit` | 1–200, default 50 |

`200 OK`: `{ "count", "limit", "events": [ … ], "next_cursor" }`.

| Status | `code` | When |
|---|---|---|
| 400 | `invalid_request` | the cursor belongs to another key scope, organization or filter |
| 403 | `missing_permission` | no `event_read` |
| 410 | `gone` | the cursor is older than the 30-day retention |

## Inbox events

`GET /v0/inboxes/{inbox_id}/events`

Permission `event_read`. Same parameters (except `inbox_ids`) and response, for one inbox.

## WebSocket

`GET wss://api.simail.ai/v0/ws`

Permission `event_read`. Upgrades to a WebSocket. See [Realtime](/realtime/).

| Close code | Meaning |
|---|---|
| `1000` | normal close, including the 1-hour connection lifetime; reconnect |
| `4401` | the key was revoked or narrowed, or the organization was paused; do not reconnect with this key |
