# Server API: events

Source: https://docs.neode.sk/development/api-reference/server-events/
Last updated: 2026-12-03

> 1 operation. The live stream of server events over a WebSocket.

These routes are on the server API, port 21114 (21121 in Docker). They take an API key in `X-API-Key` or a sign-in token; see [The HTTP API](https://docs.neode.sk/development/api.md#signing-in).

The live stream of server events over a WebSocket.

## GET /api/ws/events

Stream server events.

Opens a WebSocket. Each message is one event as JSON: {"type", "timestamp", "data"}, where data holds text values. The server only sends. Origins other than the server's are refused unless API_WS_ALLOWED_ORIGINS lists them.

On the server API, port 21114. Needs `audit.view`.

| Parameter | In | Type | What it is |
|---|---|---|---|
| `filter` | query | string | Only events of this type, such as peer_online; all when missing |

**101**: Switching to the WebSocket

| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
| 503 | The event bus is not available |
| default | The request was not a WebSocket upgrade the server could take (plain text) |
