Real-time: live events and calls
Section titled “Real-time: live events and calls”This page is for developers who want changes pushed to them instead of polling: keep an open record current, show notifications as they arrive, or follow a job you started over HTTP. It also covers the tokens for audio and video calls.
The live channel is push-only and best-effort. You subscribe and receive events; every write, and every authoritative read, still goes through the HTTP API.
Connect
Section titled “Connect”The channel speaks Socket.IO v4 — a plain WebSocket client cannot connect. Use a Socket.IO v4 client library and connect to the tenant’s own host, on the default Socket.IO path:
import { io } from 'socket.io-client';
const socket = io('https://acme.example.com', { transports: ['websocket', 'polling'], // A function, so every reconnect sends a fresh token auth: (cb) => cb({ token: getAccessToken() }),});
socket.on('connect_error', (err) => console.error('socket refused:', err.message));- The credential is an OAuth access token — the same one you use for HTTP calls —
or, on public pages, an anonymous token.
An API token cannot open a socket: a service that calls the API with
x-app-tokenneeds a user’s OAuth token for the socket. For a service, that means the password grant for a dedicated service account, which must be an ordinary user: an application user has no password and cannot sign in. A client-credentials token is not enough. It opens the socket, but it has no user, sosubscribeToNotificationsis refused. - A handshake without a token is refused
Since 1.6, and so is an invalid or inactive token (Invalid token). - The token is checked once, at the handshake. An open socket is not closed when the token later expires, but every reconnect is a new handshake — supply a fresh token each time, as in the example.
- Connect to the tenant’s own host
Since 1.10. On a multi-tenant deployment the socket belongs to the tenant of the host you connect to. A host that matches no tenant is refused withTenant not resolved, and a token from another tenant is not accepted.
A headless worker or backend process follows the same rules; the extra care it needs (second credential, reconciliation) is in Subscribing to events.
Subscribe
Section titled “Subscribe”A new socket receives nothing until you subscribe. Each subscription has an acknowledgement — wait for it before assuming you are subscribed, because some failed joins report no error.
| Emit | Payload | Acknowledgement | You then receive |
|---|---|---|---|
subscribeToNotifications | none — your identity comes from the token | subscribedToNotifications {userId} | Your notifications and job completions |
entries/subscribe-to-entry Since 1.4 | {entityId, entryId} | subscribedToEntry {entityId, entryId} | Changes to that record |
entries/unsubscribe-to-entry Since 1.4 | {entityId, entryId} | unsubscribedFromEntry {entityId, entryId} | — |
subscribeToJobExecution Since 1.6 | {messageId} | subscribedToJobExecution {messageId} | The job’s completion |
unsubscribeFromJobExecution Since 1.6 | {messageId} | unsubscribedFromJobExecution {messageId} | — |
A missing messageId, entityId or entryId produces an error event
({message}) instead of a subscription. subscribeToNotifications on a socket with no
resolved user emits error and disconnects.
Events you receive {#server—client-events}
Section titled “Events you receive {#server—client-events}”| Event | Arrives when you subscribed to | Meaning |
|---|---|---|
notification | Notifications | A notification was created for you; the payload is the notification record. |
entries/value-updated | The record | Field values changed. Since 1.10 the payload may carry the record’s updateIdentifier. |
entries/workflow-updated | The record | The workflow moved: a step reached or left, an action executed, an owner changed, an ad-hoc step added. Carries eventName. |
entries/comments-updated | The record | A comment was added or changed. Carries eventName. |
entries/archived Since 1.6 | The record | The record was archived. |
entries/restored Since 1.6 | The record | The record was restored. |
entries/virtual-entry-created Since 1.8 | The source record | A virtual record was created from it. |
entries/virtual-entry-updated Since 1.8 | The source record | A virtual record created from it was updated. |
osos/infrastructure/job-executed | The job, and notifications | A background job finished. The payload carries messages and result. |
icons-updated | — (every socket of the tenant) | The icon set changed. |
request-entry-modified | — (every socket of the tenant) | A request was created, updated or archived: {requestId, originalEntryReference, operation}. |
packages/changed Since 1.10 | — (every socket of the tenant) | A package’s review or store state moved: { $name, $version: 1, packageId }. Re-read the package over HTTP. |
error | — | A subscribe or unsubscribe call was invalid. |
Recipes
Section titled “Recipes”Keep an open record current
Section titled “Keep an open record current”socket.emit('entries/subscribe-to-entry', { entityId, entryId });socket.on('entries/value-updated', (e) => refreshFields(e));socket.on('entries/workflow-updated', (e) => refreshWorkflow(e));socket.on('entries/comments-updated', (e) => refreshComments(e));
// when the screen closes:socket.emit('entries/unsubscribe-to-entry', { entityId, entryId });Warn when someone else saved first Since 1.10
Section titled “Warn when someone else saved first Since 1.10”entries/value-updated may carry the record’s current
updateIdentifier. Compare it with
the one you read:
- No token yet, or the same token — nothing changed for you.
- A different token — someone else saved after your last read. Tell the user, offer a reload, and stop an open editor from saving over the newer version.
Two cautions:
- This is a courtesy, not the protection. A client that missed the event still gets
409 UPDATE_CONFLICTfrom the write itself. - Your own save causes several follow-up writes (indexing, automations), each with a new token. Ignore the comparison while your own save is in flight, or you will warn the person who just saved.
Follow a job you started over HTTP
Section titled “Follow a job you started over HTTP”// An HTTP call answered with a messageIdsocket.emit('subscribeToJobExecution', { messageId });
socket.on('osos/infrastructure/job-executed', (evt) => { if (evt.messageId !== messageId) return; // may also arrive via notifications confirmOverHttp(messageId); // the status call is authoritative});Subscribe right after starting the job: an event that fires before your subscription is not replayed. Confirm the final state with the job’s status call — see Long-running work.
Delivery rules
Section titled “Delivery rules”- Best-effort, no replay. Record events are sent only while someone is subscribed, and nothing is kept for a disconnected client. After every connect or reconnect, subscribe again and re-read what you show over HTTP.
- Notifications are not filtered by space. You receive notifications from every
space you belong to.
Since 1.10the platform’s web client hides those of other spaces itself; a custom client should filter on the notification’svalue.space. - Delegated actions notify two people. When a notification comes from an action done on someone’s behalf, both the recipient and the person who acted receive it.
- Unsubscribing quickly can suppress virtual-record events. They are sent about a second after the change, and only if you are still subscribed.
Audio and video calls
Section titled “Audio and video calls”The platform issues tokens for audio and video channels run by Agora. It does not carry the media itself. Get a token through the API with your normal credential, then join the channel with the Agora client SDK:
curl -s "https://acme.example.com/api/rtc/<channel>/publisher?expiry=3600" \ -H "Authorization: Bearer <access-token>"{ "success": true, "result": { "rtcToken": "<token>", "userId": "<your-user-id>" } }| Part | Values |
|---|---|
<channel> | The channel name. Required. |
| role | publisher (sends audio/video) or audience (receives only). Anything else is 400. |
expiry | Seconds the token is valid. Optional, default 3600. |
The token is issued for your user id; you cannot request one for another user. The Agora app id the client needs comes from your operator’s configuration.
Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27