Workroom Runtime Contract | Kamiwaza Docs

Version: 1.0.1 (Latest)

Workrooms overview

Workrooms support runtime-scoped applications, shared membership, and a collaboration SSE feed. This page summarizes the public behaviors extension authors and operators can rely on when they integrate apps with workroom context.

Runtime app binding

A runtime application can be launched inside a workroom. While it is running in that workroom:

When a user leaves a workroom, the platform refreshes any bound runtime sessions so the departing user's access is dropped. The refresh completes within the runtime launch token's TTL (minutes, not hours) - the outgoing user's token is not proactively revoked, but it is not renewed, so any in-flight call survives at most until the current token expires.

Membership and roles

The workrooms API exposes roster operations that runtimes and the Workroom Manager UI share:

Endpoint Purpose
GET /api/workrooms/{workroom_id}/members List members visible to the caller.
POST /api/workrooms/{workroom_id}/members Invite or add a member.
PATCH /api/workrooms/{workroom_id}/members/{member_user_id} Update a member's role.
DELETE /api/workrooms/{workroom_id}/members/{member_user_id} Remove a member (see active-session confirmation below).

Active-session confirmation mechanism. Confirmation is carried as the query parameter ?confirm_active_sessions=true on the DELETE request:

  1. Client issues DELETE /api/workrooms/{workroom_id}/members/{member_user_id} without the query parameter (or with false).
  2. If the target has one or more active workroom sessions, the server returns HTTP 409 with detail: "Member has active workroom sessions; confirm removal to continue". The membership is not modified.
  3. Client surfaces the confirmation prompt to the operator, then retries with DELETE /api/workrooms/{workroom_id}/members/{member_user_id}?confirm_active_sessions=true.
  4. On the confirmed retry, the server removes the membership and terminates any bound runtime sessions for that user as part of the same request.

If the target has no active sessions, the initial DELETE succeeds without the query parameter. There is no request body or custom header - the mechanism is purely the query-string flag plus the 409 retry handshake.

Collaboration SSE feed

Clients can subscribe to a per-workroom SSE stream for presence and collaboration signals:

GET /api/workrooms/{workroom_id}/events/stream

Accept: text/event-stream

Authorization: Bearer <token>

Accepted bearer types. The Authorization header accepts any of the following, in order of preference:

Tokens that do not resolve to a current member of the workroom receive 403. Expired tokens receive 401; reconnect with a freshly issued token and the Last-Event-ID header for resumable delivery.

Event categories:

Each event includes a stable id, an event type, and a JSON data payload. Clients should honor the retry hint and reconnect with the last event id for resumable delivery.

Rate limits and connection budget.

Behavior to rely on