STATUS: Stub. This page is a structural placeholder — the
consolidated documentation set does not include the racelink/web/
source code, so the canonical request and response shapes cannot be
derived from this snapshot alone. The route names below are
compiled from references in the migrated docs (see "Source
material" at the end). Filling in the request / response shapes
requires a pass over racelink/web/api.py in the source repository.
The host exposes a REST API that the WebUI and the RotorHazard
plugin call. Everything is mounted under the WebUI's prefix:
All POST/PUT bodies are JSON. Reading order: validate input,
then call into a service, then return.
Validation errors raise RequestParseError (a ValueError
subclass) inside the route handler, which is caught and
translated to HTTP 400 with a body of
{"error": "<message>"}.
Other exceptions are caught at the top of each handler, logged
with type + traceback, and translated to HTTP 500.
Long-running operations are kicked off via the task manager;
routes return {"ok": true, "task": <snapshot>} immediately.
Progress is delivered over SSE — see
SSE_CHANNELS.md.
Start an OTA workflow. Body includes the binary path / upload, target MACs, OTA password, "Skip firmware-name validation" flag, WiFi options. Returns the task snapshot.
The OTA workflow's progress reaches the dialog via the task SSE
event with name="fwupdate". The per-device progress fields
(stage, index, total, addr) are documented in
../host/docs/DEVELOPER_GUIDE.md
§"Adding a new task-manager-driven workflow".
Confirm the exact path and HTTP method against
racelink/web/api.py.
Document the request body shape (validated by
racelink/web/request_helpers.py).
Document the response body shape.
Document the error responses (which RequestParseError
messages are user-facing).
Cross-link to the service that owns each route and to the
matching SSE refresh tokens.
A future revision should regenerate this page from the source — the
service docstrings already declare public APIs and threading
expectations (see ../host/ARCHITECTURE.md
§"Service Layer"); the same docstrings can drive an autogen.