events
GET /events
Server-sent events for the calling studio.
R41, 07 §3. Each event carries `id:` (opaque), `event:` (its name) and `data:` (JSON). Reconnect with `Last-Event-ID` to resume; the provider keeps the last 1024 events. When the id is older than that, was issued by a provider that has since restarted, or was never issued, `gap` comes first and the stream continues from now (second review #2). A studio receives `item` events for its own items, or for every studio's with `gallery.read_all`; `inbox` for handoffs to it; `job` for its own studio's jobs; `theme` to every studio whenever the launcher's theme is set (M6 Q8). A page follows the theme through `GET /theme/events` instead, which needs no token. `: ping` comments keep the connection open.
Any studio token.
| Go | Subscribe(ctx context.Context, params *EventsSubscribeParams) (*EventStream, error) |
|---|---|
| Python | def subscribe(self, *, last_event_id: Optional[Any] = None) -> Any |
| JavaScript | subscribe(params = {}) |
| Parameter | In | Type | About |
|---|---|---|---|
| Last-Event-ID | header | string |
Events:
- gap → GapEvent
- inbox → InboxEvent
- item → ItemEvent
- job → JobEvent
- shutdown → ShutdownEvent
- theme → ThemeEvent
| Status | Body | Means |
|---|---|---|
| 200 | string | An event stream. |
| 401 | Error | No studio token, or a revoked or unknown one. Code `unauthenticated`. |