GET /controls/stream (SSE)

Available

Live channel for controls. Server-Sent Events; poll or delta as fallback.

GEThttps://ctrlapp.krdcode.com/api/public/sdk/v1/controls/stream
Auth: Bearer <PUBLISHABLE_KEY>

Query

  • device_uid — required.
  • since — ISO cursor for the initial snapshot.

The response is text/event-stream. Frames observed on the wire:

  • event: hello{ "cursor": "<iso>" } once at connect.
  • event: update — a full per-device snapshot whenever the app cursor advances past this device's cursor. Payload shape: { "changed": <controls-map>, "deleted": ["<key>", ...], "cursor": "<iso>", "snapshot": true }. Replace the local map with changed and remove any keys in deleted.
  • : heartbeat comment every ~25 s.
  • event: bye{ "reason": "max-duration" } after the 5-minute cap; reconnect with the last cursor.

Fallback

If SSE is blocked by a proxy or the client cannot hold an open connection, poll /controls/delta at your chosen interval. The delta payload uses { snapshot, controls, deleted } — same "replace the local map" contract, different field name for the map.

Errors

  • 400 — missing device_uid.
  • 401 — bad key.
Back to top