Skip to main content
This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.
This connection delivers live updates of the AI chat for the apps a white-label session can watch. It uses Socket.IO, not a raw WebSocket. Connect with io(socket_url, { path: socket_path, transports: ["websocket"], auth: { session_token } }), using the values your server received from POST /api/v1/socket-sessions. Then send join for each app to receive the app’s snapshot, followed by live events. Available only to white-label workspaces on the Builder plan or higher, with live AI chat updates turned on. Ask your onboarding contact to turn them on for your workspace. Send the session token in the Socket.IO CONNECT auth as session_token. A refused connection is a connect_error with message: "connection_denied" and data: { retryable }. If retryable is true, retry with backoff. Otherwise, ask your server for a new session. One connection per session carries the events of every app it joins. In an event’s data, a missing field is unchanged and an explicit null clears it. The app.snapshot event is the exception, since it replaces the app’s state.

Event format

Every event the server sends is an object with two fields:
string | null
required
The app the event belongs to, as /apps/{app_id}. It is null for session.ended, which concerns the whole session.
object
required
The event’s payload. Its fields depend on the event.
Example

Events from the server

message.updated

A chat message was added or replaced. Replace the message with the same id. data fields
object
required
The message in full, as it now reads.
string | null
ID of the conversation the message belongs to. Each branch has its own conversation, so a viewer showing one branch can drop another branch’s messages.
string | null
ID of the branch the change belongs to. Omitted or null means the main branch.
Example

message.removed

A chat message was removed or hidden. An id the viewer never saw is a no-op. data fields
string
required
ID of the removed message.
string | null
ID of the conversation the message belongs to. Each branch has its own conversation, so a viewer showing one branch can drop another branch’s messages.
string | null
ID of the branch the change belongs to. Omitted or null means the main branch.
Example

app.status_changed

The AI started, finished, or failed a turn. Null status clears it. data fields
object | null
required
The new status, or null when the status was cleared.
string | null
ID of the branch the change belongs to. Omitted or null means the main branch.
Example

preview.reload_requested

Reload the app preview. data fields
string | null
ID of the branch the change belongs to. Omitted or null means the main branch.
Example

preview.navigation_requested

Show this page of the app in the preview. data fields
string
required
Path of the page to show, relative to the app’s root, such as /settings.
boolean
required
Navigate even when the user has moved away from the page.
string | null
ID of the branch the change belongs to. Omitted or null means the main branch.
Example

queue.updated

The whole prompt queue, after any change. data fields
object[] | null
Queued prompts, in the order they will run.
boolean | null
Whether the queue is paused, so queued prompts wait. A person can pause it, and Base44 pauses it while the AI waits for an answer.
string | null
ID of the queued prompt the AI just picked up to run. Absent when a prompt was added, removed, or cleared.
string | null
ID of the branch the change belongs to. Omitted or null means the main branch.
Example

task.progressed

Progress of a long-running tool, by tool_call_id. data fields
string | null
ID of the tool call that started the task.
string | null
ID of the message that holds that tool call.
'task_started' | 'task_progress' | 'task_completed' | 'task_failed' | 'task_cancelled' | null
Kind of progress update. The value is task_started, task_progress, task_completed, task_failed, or task_cancelled.
object | null
Progress so far.
string | null
ID of the branch the change belongs to. Omitted or null means the main branch.
Example

image.resolved

A generated image finished or failed. Replace its placeholder_url wherever it appears. data fields
'pending' | 'completed' | 'failed' | null
State of the image. The value is pending while the image generates, completed once image_url is ready, or failed when generation failed.
string | null
Placeholder URL the app shows while the image generates. Match it to find where the image appears.
string | null
URL of the finished image, or null while it is pending or after it failed.
Example

conversation.changed

The conversation was rewritten by an undo, restore, or sync. Rejoin the room for a fresh snapshot. data fields
string | null
ID of the branch the change belongs to. Omitted or null means the main branch.
Example

files.changed

The app’s files changed outside a chat turn. data fields
string | null
ID of the branch the change belongs to. Omitted or null means the main branch.
Example

branch.deleted

A branch was deleted. data fields
string | null
ID of the branch the change belongs to. Omitted or null means the main branch.
Example

repository.changed

The imported app’s repository changed. data fields
string | null
ID of the branch the change belongs to. Omitted or null means the main branch.
Example

pull_request.changed

The imported app’s pull request changed. data fields
string | null
ID of the branch the change belongs to. Omitted or null means the main branch.
Example

session.ended

The session ended because it expired, was revoked, or was taken by a newer socket. The socket disconnects next. data fields
'expired' | 'revoked' | 'replaced'
required
Why the session ended. When it’s expired, ask your server for a new session. When it’s revoked, your server or an admin ended it, so don’t reconnect. When it’s replaced, a newer socket took the session, so stop.
Example

room.access_denied

A join was refused because the app is not on the session’s allowlist, or the socket joins too often. data fields The data object is empty.
Example

room.access_revoked

The app left the session’s allowlist, or its workspace. Events for it stop. Do not rejoin. data fields The data object is empty.
Example

room.snapshot_unavailable

The join held but its snapshot failed. Live events still arrive. Rejoin later for a snapshot. data fields The data object is empty.
Example

app.snapshot

The app’s current status and its last 50 public messages, after every join. Replace the app’s state with it. data fields
object | null
required
The app’s build status, or null when none is recorded.
object[]
required
The last 50 messages, oldest first.
object
required
The main branch’s prompt queue.
Example

Messages from the browser

join

Join an app’s room, once per app after every connect. An app.snapshot follows, then its live events. Refused with room.access_denied when the app is not on the session’s allowlist, or past 30 joins a minute. The payload is a string, not an object. Pattern: ^/apps/[0-9a-f]{24}$
Example

leave

Leave an app’s room. Its events stop. The payload is a string, not an object. Pattern: ^/apps/[0-9a-f]{24}$
Example