Skip to main content

HTTP API

create_reactor_app(platform) returns a FastAPI application serving the reactor's own control plane. Your plugins' routers are mounted on top of it.

Plugins and extensions

EndpointWhat it answers
GET /pluginsevery plugin, its presentation metadata, and whether it is enabled and activated
GET /extensionsevery extension and the plugins it delivered
POST /plugins/{plugin_name}/toggleenable or disable one at runtime
POST /plugins/{plugin_name}/deactivatestand a plugin down, dependants first
POST /events/{event}fire an event; answers with what stood down and what woke
GET /plugins/statethe revision, and each plugin's enabled/activated — the cheap poll
GET /events/streamserver-sent events: one message whenever the platform changes
GET /plugins/frontend-extensionsevery installed extension's frontend half, rescanned
GET /reactor-extensions/{name}/{path}that extension's files, out of the installed distribution

Cross plugins

EndpointWhat it answers
GET /plugins/frontend-requirements?active=a,bwhat enabled plugins ask of the frontend, and what of it is missing

Tenants and marketplace

EndpointWhat it answers
POST /tenants/plugins/{plugin_name}/toggleenable or disable for one tenant
GET /tenants/{tenant_id}/featureswhat that tenant may use
GET /tenants/{tenant_id}/routesthe routes that follow from it
GET /marketplacewhat is publishable and published

Serving it

reactor on the command line serves all of this against whatever extensions are installed in the environment — see the host.

Trying it

The music example drives most of these from a browser, and the same calls answer curl — which is the honest way to see that the server really changed its mind rather than the browser hiding something:

curl -s localhost:8799/api/playlist/rules # chill, energetic, a-to-z
curl -s localhost:8799/plugins/mood/toggle \
-H 'content-type: application/json' -d '{"enabled": false}'
curl -s localhost:8799/api/playlist/rules # []