---
title: "Realtime stream (WebSocket)"
method: GET
path: "/v1/stream"
tags: ["Realtime"]
---

# Realtime stream (WebSocket)

`GET /v1/stream`

## Request

- Base URL: `http://api.technooptimist.io`
- URL: `http://api.technooptimist.io/v1/stream`
- Auth: API key in query parameter `api_key`

Upgrade to a WebSocket. Authenticate with `?api_key=` (browsers cannot set headers).

Client → server: `{"type":"subscribe","topics":["all"]}`, `{"type":"unsubscribe","topics":[…]}`, `{"type":"ping"}`.

Server → client: `hello`, `subscribed`, `unsubscribed`, `pong`, `heartbeat` (every 25 s), `error`, and events

(`update.created` with `data` = FeedItem, `program.changed`, `notification`).

Topics: `all`, `frontier:<slug>`, `company:<slug>`, `program:<company>/<program>`, `user:<id>` (dev: requires matching `x-user-email`/`user_email`).

## Other responses

- `101`: Switching protocols
- `401`: Missing or invalid API key

---

[API](https://skmtc.dev/technooptimist/apis/the-techno-optimist-api.md) · [All operations](https://skmtc.dev/technooptimist/apis/the-techno-optimist-api/llms.txt) · [OpenAPI document](https://skmtc.dev/technooptimist/apis/the-techno-optimist-api/revisions/b7bcde6a0f30?raw)
