Realtime updates
Found this helpful? Share it:
Found this helpful? Share it:
Instead of polling for changes, open one long-lived connection and let idapt push events to you as they happen: run updates, notifications, and your own broadcasts all arrive on the same stream 📡
Send a GET to the subscribe endpoint and keep the
connection open. Events arrive as server-sent events, which the
browser EventSource and most HTTP clients read natively.
curl -N https://idapt.app/api/v1/realtime/subscribe \
-H "Authorization: Bearer uk_your_key_here"Every event carries an id. When the connection drops, reconnect and
send the id of the last event you processed in the Last-Event-ID header, and idapt replays what you missed
instead of starting fresh.
curl -N https://idapt.app/api/v1/realtime/subscribe \
-H "Authorization: Bearer uk_your_key_here" \
-H "Last-Event-ID: 01h0m2k3p4q5r6s7t8v9w0x1y2"The browser EventSource sends Last-Event-ID for you on an automatic reconnect, so a web client resumes with no
extra code.
Beyond the account stream you can run your own channels: broadcast an ephemeral message to everyone subscribed, and record or read who is present.
| Endpoint | What it does |
|---|---|
POST /realtime/:channel/broadcast | Broadcast an ephemeral message to a channel's subscribers. |
POST /realtime/:channel/presence | Record/refresh the caller's presence in a channel (TTL heartbeat). |
GET /realtime/:channel/presence | List who is currently present in a channel. |
GET /realtime/subscribe | Open an SSE stream of one or more channels' durable changes + ephemeral broadcasts. |
Broadcasts are ephemeral: a subscriber only sees a message sent while it is connected. Use a durable resource if you need history.
To deliver a message that persists in the recipient's inbox, use the Notifications API instead. For the request conventions the stream shares, see the REST API reference.
Related articles
Up next
Send notifications to workspace members and manage your inbox programmatically.
Was this helpful?