webstation-broker
REST API

API overview

Where the endpoints live, how they are authenticated, and which ones RomM calls versus the room UI.

Every endpoint lives under the SUBFOLDER prefix, so with the default the API root is /streaming/api/. The examples on these pages talk to a container directly on its HTTPS port; behind a reverse proxy substitute RomM's origin.

Authentication

BROKER_SECRET is a shared secret between RomM and the container. When it is set, the lifecycle endpoints require it in the X-Broker-Secret header and answer 403 otherwise. When it is unset nothing is checked, which is only sensible on a LAN you control.

Endpoints fall into three groups:

GroupCallerAuth
Lifecycle: activate, join, swap-discRomM's backendX-Broker-Secret
State and archive transfer: save-state, load-state, state-file, state-screenshot, imports, exports, memory cardRomM's backendX-Broker-Secret
Host actions: invite, exitthe room UIthe controller token as ?token=; exit also accepts the secret
Room: context, the collab websocketthe room UIa personal token in the URL
Status and healthanyonenone

The room UI never holds the secret. Its exit and invite buttons carry the controller token instead, which is why exit accepts either.

Endpoints

MethodPathPage
POST/api/session/activateLaunch a game
POST/api/session/swap-discLaunch a game
POST/api/session/joinUsers and invites
POST/api/session/inviteUsers and invites
POST/api/session/save-stateSave states
POST/api/session/load-stateSave states
GET / PUT/api/session/state-fileSave states
GET/api/session/state-screenshotSave states
POST/api/session/exitExit
PUT/api/session/imports/{name}.zipSave archives
GET / DELETE/api/session/exports[/{name}.zip]Save archives
GET / PUT/api/session/memory-cardSave archives
GET/api/session/statusStatus
GET/api/healthStatus

The request and response models are documented in the Python reference, and a running broker serves its own OpenAPI schema at <SUBFOLDER>/openapi.json with the interactive explorer at <SUBFOLDER>/docs.

Conventions

  • Status codes carry meaning. 409 is "there is no session" (or "there already is one" on activate). 400 is "the running emulator cannot do that", for example a state route on an emulator without save states. 413 is a body over a configured ceiling. 422 is a payload the broker could not act on.
  • A "failed" status is a real answer, not an error. Save and load report failed when the emulator did not acknowledge, or the slot held no state.
  • Slots resolve to the emulator's working slot. RomM is the library of states, so each emulator works in exactly one slot and echoes the slot it actually used. Whatever slot a request names, the response says which one it landed in.

On this page