Overview
The AI Studio mobile sync API connects AgentLab OS to the AI Studio mobile dashboard in both directions. It exposes four endpoints:GET /api/sync/stateexports the live operational state of AgentLab OS to your mobile dashboard.POST /api/sync/ingestingests roaming and field data (leads, voice notes, observations, quick tasks) into AgentLab OS.POST /api/sync/actionexecutes remote actions such as triggering a workflow or approving a paused run.POST /api/aistudio/webhook/registerregisters a mobile callback URL so AgentLab OS pushes live updates back to AI Studio.
/api/sync/* endpoint is also available under an /api/aistudio/* alias (/api/aistudio/state, /api/aistudio/ingest, /api/aistudio/action). Both paths call the same handler.
Authentication
The tenant middleware scopes requests to a workspace:- Send a Bearer JWT in the
Authorizationheader. AgentLab resolves the workspace from the token’semailclaim. - Without a token, send an
X-Workspace-Idheader to select a workspace directly. If the header is omitted, requests fall back to the default workspace.
Export operational state
GET /api/sync/state returns a snapshot of the workspace for the mobile dashboard: system health, workflow metrics, deployed workflows, runs paused for approval, recent audit logs, and the last 10 roaming ingestions.
200):
500 if the state cannot be compiled.
Ingest roaming data
POST /api/sync/ingest records mobile-captured data in AgentLab OS. AgentLab writes every ingestion to the audit log and can optionally trigger a workflow run.
201):
status is ingested when no workflow was triggered and routed_to_workflow when the entry started a run. After each ingestion, AgentLab dispatches a ROAMING_DATA_INGESTED event to all registered mobile webhooks for the workspace.
Execute remote actions
POST /api/sync/action runs a command against the workspace from the mobile dashboard. Pass an action field plus the parameters that action requires:
200):
400 for an unknown action or a missing required field, and 503 if the database is unavailable.
Register a mobile webhook
POST /api/aistudio/webhook/register subscribes a callback URL to workspace events so AgentLab pushes updates to your mobile dashboard without polling.
201):
400 if endpointUrl is missing or does not start with http.
AgentLab holds webhook subscriptions in server memory. Re-register your endpoint after a server restart.

