BETA

Real-time lab events over WebSocket

Reference3 min readUpdated July 2026

The Studio canvas does not poll for what changed in a lab - it holds a WebSocket open and reacts to events as they happen: a node starting, a link going down, another user joining the same lab. That same feed is open to your own code at /ws/labs/{lab_id}, authenticated with the JWT you already use for the REST API.

The message shapes below are captured verbatim from a real connection - not hand-written examples.

Connect (token as a query param - this is a plain WebSocket, so any client library works):

wscat -c "ws://your-netplex-host:8088/ws/labs/<lab-id>?token=$NETPLEX_TOKEN"

On connect, the server sends a handshake confirming the subscription (real capture):

{
  "type": "connected",
  "lab_id": "9adb1aca-240f-4ea7-a737-afb20a31acaf",
  "user_id": "7ae603b6-8fb6-418a-be44-2949faa37c35",
  "message": "Subscribed to lab 9adb1aca-240f-4ea7-a737-afb20a31acaf events",
  "collaborators": ["7ae603b6-8fb6-418a-be44-2949faa37c35"]
}

Every subsequent message wraps a real platform event (also a real capture - here, a second browser tab joining the same lab):

{
  "type": "event",
  "stream_id": "1783452373766-0",
  "event": {
    "id": "55894365-72c7-417c-bc0d-5ebc587f25ba",
    "topic": "lab.collab_joined",
    "payload": { "lab_id": "...", "user_id": "...", "collaborators": ["..."] }
  }
}

Topics you'll see cover every lifecycle stage of a lab - lab (lab.started, lab.stopped, lab.error), nodes (node.added, node.starting, node.stopped, node.deleted, node.renamed, node.error), links (link.created, link.removed, link.hot_attached, link.qos_applied, link.blocked), configs (config.saved, config.rollback, config.export), captures (capture.started, capture.stopped, capture.error) and collaboration (lab.collab_joined) - the same topic strings the Studio event log renders under Events/Problems.

Use this to drive a dashboard, trigger external automation on a lifecycle event, or mirror the Studio's own live-update behaviour in a custom tool - without polling the REST API on a timer. See "REST API quickstart" for the token this connection reuses, and "Read the event log" for the same feed as it appears inside the Studio UI.