Skip to content

API Documentation

This section documents the on-device REST API exposed by the OWTS firmware.

HTTPS + conditional write protection

  • The UI and API are served over HTTPS (self-signed certificate). See Firmware HTTPS.
  • GET endpoints are intentionally public (read-only).
  • Mutating endpoints (PUT, PATCH, POST, DELETE) require Authorization: Bearer <password> only when an API password is configured on the device (default: no password configured).

Getting Started

Source of truth

The OpenAPI specification lives in the repository at:

The API is RESTful and uses standard HTTP methods:

  • GET - Retrieve resources
  • POST - Create resources
  • PUT - Update resources
  • DELETE - Remove resources

All API endpoints return JSON responses.

Logs

The device exposes a small in-RAM ring buffer of recent log lines:

  • GET /api/log

Use ETag + If-None-Match (304) and the after query parameter for efficient polling.

Hardware errors

GET /api/hw/errors is public. The ETag is W/"<revision>". Send that value as If-None-Match to receive 304 when nothing changed.

DELETE /api/hw/errors clears one latched code when code is set, or every latched code when it is omitted. It requires Authorization: Bearer when an API password is configured.

Live snapshots

  • GET /api/live upgrades to a WebSocket. Aircraft mode pushes the runtime IAS snapshot (flight_phase / is_landed, same semantics as the OLED). Winch mode pushes the last decoded telemetry object.

The server sends a text frame when the snapshot changes (at most every 200 ms). During landing_hold, elapsed whole seconds count as a change. The client sends {"type":"ping"} at least every 5 s. No bearer token.

Interactive Documentation

For interactive API documentation with request/response examples, see the Swagger UI page.