- Home
- Developers
- Streams and webhooks
API guide
Subscribe to live show changes
A confidence monitor needs the current state after a reconnect. An automation needs to know whether it has already processed a delivery. Choose a transport based on which problem you need to solve.
ON THIS PAGE
Choose the transport
| Consumer | Transport | Why |
|---|---|---|
| A read-only stage display | Server-sent events (SSE) | One HTTP connection receives a snapshot followed by room changes. |
| A controller that subscribes and sends commands | Socket.IO | Two-way events and command acknowledgements on namespace /v1, path /v1/socket.io. See the AsyncAPI contract. |
| A backend that reacts to cue changes | Signed webhooks | The service delivers an HTTP POST to your HTTPS endpoint and retries unsuccessful deliveries. |
Open a single-room stream
Use API, ROOM and a room-authorized read credential from the quickstart. -N disables cURL buffering so each event appears as it arrives. Press Ctrl+C to disconnect.
curl -fsSN "$API/rooms/$ROOM/stream" \
-H "Authorization: Bearer $RUNOFSHO_KEY" \
-H 'Accept: text/event-stream'
On first connection, use state.snapshot to render the room. On a reconnect, send the last SSE id in Last-Event-ID. The single-room endpoint replays buffered changes when it can; accept a fresh snapshot when it cannot. If your client detects a gap, read the room state again. Do not treat the multi-room stream as having the same replay contract.
A countdown does not require an event every second. Render from the playback timestamps using a clock synchronized to GET /v1/time. For a public display, use a room-limited output credential, not a team API key. Native browser EventSource cannot set a bearer header; use an authenticated streaming client rather than moving the key into the URL.
Receive and verify a webhook
Webhook setup requires a team admin credential and a plan that includes webhooks. Create a subscription with POST /v1/webhooks, store the returned signing secret immediately, then use the test-delivery endpoint before connecting the receiver to a real workflow.
- Read the raw request body before parsing JSON. Read
Runofsho-Signature, which containst(Unix seconds) andv1(hex digest). - Verify freshness and signature: use a five-minute timestamp tolerance and compare HMAC-SHA256 of
t + "." + rawBody, keyed with the webhook secret, using a constant-time comparison. Reject an invalid signature. - Deduplicate by delivery
idand durably record or enqueue the work before acknowledging it. Return a 2xx within ten seconds; perform slow work asynchronously. - Compare room versions rather than assuming arrival order. If a delivery fails, inspect the delivery log before requesting a retry.
Endpoint reference
- Stream a room's events (SSE):
GET /v1/rooms/{roomId}/stream(streamRoom). - Stream several rooms (SSE):
GET /v1/stream(streamRooms). - Create a webhook:
POST /v1/webhooks(createWebhook). - Send a test event:
POST /v1/webhooks/{webhookId}/test(testWebhook). - List a webhook's deliveries, newest first:
GET /v1/webhooks/{webhookId}/deliveries(listWebhookDeliveries). - Send a delivery again:
POST /v1/webhooks/{webhookId}/deliveries/{deliveryId}/retry(retryWebhookDelivery).