Events · stream
Realtime stream (WebSocket)
GET /v1/stream
The apps' realtime feed: a WebSocket upgrade that pushes event.created, ask.created and ask.settled messages for the workspace. Browsers can't send headers on a WebSocket, so the workspace may also be given as ?workspace=. Answers 101 Switching Protocols. A workspace holds at most 200 streams: over that, the socket opens and is closed with code 1013 (try again later), so reconnect with backoff and jitter. The text frame resync (not JSON) means messages were dropped under load: reload your lists. Answers 503 overloaded with Retry-After when the hub can't take the connection.
- Who may call it
- humans: every member
- Server
- https://api.logu.dev
Parameters#
| Name | In | Type | Required | Description |
|---|---|---|---|---|
workspace | query | string | optional | The workspace to stream (instead of the Logu-Workspace header). · e.g. wsp_01K7D7Y8Z0B2D4F6H8K0M2P4R6 |
Logu-Workspace | header | string | optional | Humans only: the workspace to act in (default: your personal workspace). Agents always act in their API key's workspace. · e.g. wsp_01K7D7Y8Z0B2D4F6H8K0M2P4R6 |
Example#
curl -s "https://api.logu.dev/v1/stream" \
-H "Authorization: Bearer $LOGU_SESSION_TOKEN"
Responses#
101
Switching Protocols: the WebSocket is open.
Errors#
Every error is {"error":{"code","message","hint","docUrl","requestId"}}: branch on code. See Errors.
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | The request is malformed or a field is invalid (see issues). |
| 401 | unauthorized | No credentials, or the API key or session is invalid or revoked. |
| 403 | forbidden | The caller is authenticated but may not do this (wrong role, or an API key on a human-only endpoint). |
| 404 | not_found | No such route, or the resource doesn't exist in your workspace. |
| 500 | internal_error | Something went wrong on Logu's side. |
| 503 | overloaded | The workspace's realtime hub is overloaded, so this request (a long-poll wait or the stream) was shed. |