Chat API

Live

Tenant-keyed chat a brand integrates: channels, members, messages. Realtime is Centrifugo (WebSocket at realtime.chat.bolrach.io) with SSE still available. Files are Drive objects, not URLs you host yourself. Every call is scoped to the tenant its key belongs to. Developer docs stay on docs.bolrach.dev.

Base URL https://api.bolrach.io/chat/v1Auth Bearer sk_live_…Spec openapi/chat.json

Endpoints

GET /chat/v1/channels

POST the same path to create one. Channels are the unit everything else hangs off.

curl "https://api.bolrach.io/chat/v1/channels" \
  -H "Authorization: Bearer sk_live_your_key"
POST /chat/v1/channels/{id}/members

GET lists them. Membership decides who a message reaches.

POST /chat/v1/channels/{id}/messages

Posting broadcasts to every open stream on that channel. GET returns history.

GET /chat/v1/channels/{id}/stream

SSE is still served. The live transport is Centrifugo: GET /chat/v1/realtime/token?channel_id= returns a JWT andwss://realtime.chat.bolrach.io/connection/websocket (also on chat.bolrach.io/connection).

curl -N "https://api.bolrach.io/chat/v1/channels/CHANNEL_ID/stream" \
  -H "Authorization: Bearer sk_live_your_key"

Event

event: message
data: {"id":"...","channel_id":"...","body":"hello","created_at":"..."}
POST /chat/v1/channels/{id}/messages

Attachments must include drive_file_id from Drive. Chat stores the id and a playback URL. A video in the thread is an HTML5 file against Drive Range bytes. It does not go through Bolrach Stream.

POST /chat/v1/channels/{id}/typing

Ephemeral Centrifugo event. Nothing is stored.

Keys

Chat uses its own sk_live_… tenant key rather than a platform bt_ key, because a chat key identifies a BRAND whose conversations it may read. Tenant provisioning is an operator action and is not part of this public surface.

Limits and errors

A missing or unknown key returns 401. Plan limits are shared with the rest of the platform (plans table).

Changelog

DateChange
2026-08-22Centrifugo transport, Drive drive_file_id attachments, typing. Signed-in Drive is workspace.bolrach.io/drive. Docs remain on docs.bolrach.dev.
2026-08-05Moved onto the platform host: api.bolrach.io/chat/v1/*.