Realtime API
The API your apps and backend use to connect, publish, subscribe and manage topics, with every endpoint at a glance.
The Realtime API is what clients connect to. Your apps use it to publish and subscribe; your backend uses it to publish, manage private topics, open direct messages and disconnect users. The JavaScript SDK speaks it for you; this section is for other languages and for anyone who wants to know exactly what happens on the wire.
Base URL
Each segment's Connect tab shows its Realtime URL, for example https://realtime.folkways.net. One host serves
every transport over TLS on port 443:
- WebSocket:
wss://realtime.folkways.net/v1/ws - HTTP:
https://realtime.folkways.net/v1/…
Paths are versioned (/v1). The segment is never in a path or query string: it comes only from the token.
Endpoints
| Endpoint | Body | Auth | For |
|---|---|---|---|
GET /v1/ws | Frames | Token in the first frame | Apps: live publish and subscribe |
POST /v1/publish | Frames | Authorization: Bearer <token> | Publishing without a connection |
POST /v1/poll | Frames | Authorization: Bearer <token> | Receiving where WebSockets are blocked |
POST /v1/token | JSON | Authorization: Bearer <publishable key> | Trading a publishable key for an anonymous token |
POST /v1/dm/open | JSON | Service token | Opening a DM or group room |
POST /v1/members/add | JSON | Service token | Granting members ops on a private topic |
POST /v1/members/set | JSON | Service token | Setting one member's ops |
POST /v1/members/remove | JSON | Service token | Removing members |
POST /v1/members/clear | JSON | Service token | Removing every member |
POST /v1/members/list | JSON | Service token | Listing members |
POST /v1/kick | JSON | Service token | Disconnecting an identity |
POST /v1/revoke | JSON | Service token | Revoking one token |
Two kinds of body
- Frames. The WebSocket,
/v1/publishand/v1/pollcarry binary packets of FlatBuffers frames:Publish,Subscribe,Deliverand so on. One schema covers all three. See Payload format and the frame reference. - JSON. The token, DM, members, kick and revoke endpoints take and return JSON. Errors are
{ "code", "error", "message" }with an HTTP status.
Errors
Every transport uses the same numbered error codes, such as 203 Forbidden or
300 RateLimited. On a WebSocket they arrive as frames; over HTTP they also set the status code.
Browsers and CORS
/v1/publish, /v1/poll and /v1/token accept requests from any origin, with no cookies. The backend endpoints
(DMs, members, kick, revoke) don't allow browsers at all: they need service tokens, which never belong in an app.
WebSockets need no CORS.
Building a client
A client in a new language needs:
- FlatBuffers bindings generated from the protocol schema;
- a token, from your backend or a publishable key;
- the WebSocket lifecycle:
Hello, pings, token refresh, reconnects; - subscribing with cursors, and saving the last processed cursor per topic.
Build a client in another language walks through a complete Python client, and the client checklist lists what a production client must do.