Control

Health API

GET /api/health returns a canonical HealthStatus object for unattended exhibition monitoring. The shape is defined by health-status.schema.json in the player API contract.

{
  "device_id": "gallery-a",
  "sampled_at_unix_ms": 1785686400000,
  "uptime_sec": 3600,
  "overall_ok": true,
  "control": {
    "http": { "enabled": true, "ok": true, "error": null },
    "osc": { "enabled": true, "ok": true, "error": null }
  },
  "render": {
    "main_loop_fps": 60.0,
    "render_fps": 60.0
  },
  "display": {
    "ok": true,
    "inhibit_requested": true,
    "screensaver_inhibited": true,
    "error": null
  },
  "playback": {
    "ok": true,
    "state": "playing",
    "error_code": null
  },
  "system": {
    "ok": true,
    "clock_synchronized": true,
    "disk_total_bytes": 64000000000,
    "disk_free_bytes": 32000000000,
    "temperature_c": 52.5,
    "error": null
  }
}

Top-level fields

FieldTypeDescription
device_idstringStable device identifier (topic segment).
sampled_at_unix_msintWall-clock sample time for display only—not for ordering.
uptime_secnumberProcess uptime from a monotonic clock (NTP-safe).
overall_okboolConjunction of enabled control transports plus display, playback, and system health.
controlobjectHTTP/OSC listener health slots.
renderobjectRender FPS telemetry.
displayobjectScreensaver / DPMS inhibition status.
playbackobjectLast known playback state and error.
systemobjectOptional platform telemetry (null when unavailable).

Disabled transports use enabled=false, ok=true, error=null—configuration off, not a fault.

Control health (control)

Each slot reports enabled, ok, and error (string or null). No ports or allowlists are exposed on this public endpoint.

Render health (render)

Reports measured main-loop and present rates. It is telemetry only and does not classify a frame as frozen or decide whether the process should be restarted.

FieldDescription
main_loop_fps / render_fpsSmoothed loop and present rates.

Display health (display)

FieldDescription
okScreensaver inhibition succeeded.
inhibit_requestedAlways true; the player always requests inhibition.
screensaver_inhibitedOS inhibition is active.
errorFault when inhibition failed.

Playback health (playback)

FieldDescription
okNo active playback fault.
stateCurrent public state (idle … error).
error_codeCatalog error code or null.

Playback health does not replace GET /api/status for position and metadata.

System health (system)

Fixed nullable slots—use null when the platform cannot measure a value:

FieldDescription
clock_synchronizedNTP/RTC sync hint for Pi diagnostics.
disk_total_bytes / disk_free_bytesStorage headroom when available.
temperature_cSoC temperature when available.
errorPlatform fault string or null.

Unknown temperature, disk, or clock state does not fail system.ok unless the platform reports an explicit fault.

Monitoring use cases

Health monitoring

Poll /api/health when an external monitor needs playback, display, or control diagnostics. Render fields are measurements; any restart policy belongs to the external process supervisor.

Fleet dashboards

Poll at 1–5 s intervals for fleet dashboards.

Previous / Next