System and identity
healthreturns the cached or freshly probed gateway health snapshot.diagnostics.stabilityreturns the recent bounded diagnostic stability recorder: event names, counts, byte sizes, memory readings, queue/session state, channel/plugin names, session ids. No chat text, webhook bodies, tool outputs, raw request/response bodies, tokens, cookies, or secrets. Requiresoperator.read.statusreturns the/status-style gateway summary; sensitive fields only for admin-scoped operator clients.gateway.identity.getreturns the gateway device identity used by relay and pairing flows.system-presencereturns the current presence snapshot for connected operator/node devices.system-eventappends a system event and can update/broadcast presence context.last-heartbeatreturns the latest persisted heartbeat event.set-heartbeatstoggles heartbeat processing on the gateway.gateway.restart.preflightis a deprecated, read-only compatibility preview of restart-specific active work. It does not close admission, create a suspension lease, or provide the atomic full-work fence ofgateway.suspend.prepare; new restart flows should callgateway.restart.request.gateway.suspend.preparecreates a short cooperative-suspension lease only when tracked Gateway work is idle. While prepared, authenticated WebSocket connects remain available, but onlygateway.suspend.*and an exact targeted non-safegateway.restart.requestmay run; safe and untargeted restarts remain fenced.gateway.suspend.statuschecks the lease, andgateway.suspend.resumereleases it after thaw or an aborted host operation.
Models and usage
models.listreturns the runtime-allowed model catalog. Seemodels.listviews.usage.statusreturns provider usage windows/remaining quota summaries. Clients advertisingusage-refreshingreceive an immediaterefreshing: trueplaceholder on a cold cache and must refetch on a bounded schedule; other callers block for the cold provider read.usage.costreturns aggregated cost usage summaries for a date range. PassagentIdfor one agent, oragentScope: "all"to aggregate configured agents.doctor.memory.statusreturns vector-memory / cached embedding readiness for the active default agent workspace. Pass{ "probe": true }or{ "deep": true }only for an explicit live embedding provider ping. Pass{ "agentId": "agent-id" }to scope Dreaming store stats to one agent workspace; omitting it aggregates configured Dreaming workspaces.doctor.memory.dreamDiary,doctor.memory.backfillDreamDiary,doctor.memory.resetDreamDiary,doctor.memory.resetGroundedShortTerm,doctor.memory.repairDreamingArtifacts, anddoctor.memory.dedupeDreamDiaryaccept optional{ "agentId": "agent-id" }; omitted, they operate on the configured default agent workspace.sessions.usagereturns per-session usage summaries. PassagentIdfor one agent, oragentScope: "all"to list configured agents together. Both usage methods acceptmode: "specific"with an IANAtimeZonefor DST-aware calendar-day boundaries and buckets.utcOffsetremains supported for older clients and as a fallback when the Gateway runtime does not recognize the requested zone.sessions.usage.timeseriesreturns timeseries usage for one session.sessions.usage.logsreturns usage log entries for one session. Both detail methods accept the selected row’skeyand optionalagentId. Preserve both fields when opening details for an unqualified key such asglobal.
Channels and login helpers
channels.statusreturns built-in + bundled channel/plugin status summaries.channels.start(operator.admin) starts one channel account runtime without re-authenticating. Params{ channel, accountId? }; omittedaccountIdselects the default account. Responds{ channel, accountId, started, outcome }, withstartedtrue only when the resulting runtime snapshot reportsrunning: true.outcomecarries the account lifecycle decision:{ status: "handed-off" },{ status: "retry", reason }, or{ status: "skipped", reason }. The RPC is a manual override of automatic-start suppression; nomanualparameter is accepted. This is not a provider-connectivity check; see Per-account recovery for reasons and recovery guidance.channels.stop(operator.admin) stops one channel account runtime without clearing auth state. Params{ channel, accountId? }; omittedaccountIdselects the default account. Responds{ channel, accountId, stopped }, withstoppedtrue when the resulting runtime snapshot does not reportrunning: true. Unlikechannels.logout, it retains the account’s credentials.channels.logoutlogs out a specific channel/account where the channel supports it.web.login.startstarts a QR/web login flow. Params include optional{ channel, accountId, force, timeoutMs, verbose }. Whenchannelis present, the Gateway normalizes its canonical id or alias and dispatches only to that installed channel plugin. Omittingchannelpreserves the legacy behavior of selecting the first loaded QR-capable provider. A provider may return an opaquesessionKeywith its QR response.web.login.waitwaits for that flow to complete and starts the channel on success. Params include optional{ channel, accountId, sessionKey, timeoutMs, currentQrDataUrl }. Use the samechannelasweb.login.startand pass its returnedsessionKeythrough unchanged so the provider can correlate the wait request with the QR session. Omittingchannelretains the same legacy provider fallback asweb.login.start.push.testsends a test APNs push to a registered iOS node.voicewake.getreturns the stored wake-word triggers.voicewake.setupdates wake-word triggers and broadcasts the change.
Plugin management
-
plugins.list(operator.read) returns the installed plugin inventory plus locally curated official picks, diagnostics, and whether the current install mode allows mutations. It includes the current runtimegenerationand each plugin’s runtime state separately from configured enablement. -
plugins.inspect(operator.read) inspects one plugin with{ pluginId }, including declared capabilities, grants, trust details, and areviewTokenfor capability consent. -
plugins.search(operator.read) searches installable ClawHub code-plugin and bundle-plugin families. Pass non-emptyqueryand optionallimitfrom 1 to 100. -
plugins.catalog.browse(operator.read) returns ClawHub discovery results with Gateway-local installed and bundled state. The Control UI addssearchSource: "openclaw-control-ui"only after manual input of at least two characters settles for 250 ms. Initial browsing, refreshes, filter changes, and generic API searches omit it. The Gateway honorsCLAWHUB_DISABLE_TELEMETRYand does not replay attributed HTTP searches after transient failures. ClawHub records the normalized query, source, and remote result counts; those counts exclude local-only matches added by the Gateway. Installed inventory and operator, device, and session identities are not included in the observation. -
plugins.install(operator.admin) accepts these source-specific request fields:Each request can also includemode: "install" | "update",acknowledgeInstallPolicyWarning: true, andacknowledgeCapabilities: { reviewToken }. Omittedmodemeans install. Local paths, npm-pack archives, marketplace sources, and local Git sources require a connection the Gateway identifies as local; paths refer to that Gateway host. Use an npm spec for a specific official package version. When install policy returnswarn, the errordetailsincludeinstallPolicyCode: "install_policy_warning_acknowledgement_required", the target, reason, and optional findings. After review, retrying the same action withacknowledgeInstallPolicyWarning: trueapproves every warning in that install invocation; each warning is freshly evaluated before installation continues.blockand policy failures remain terminal. ClawHub installs preserve Gateway trust and integrity checks. -
plugins.setEnabled(operator.admin) changes one installed plugin’s enabled policy with{ pluginId, enabled, acknowledgeCapabilities? }. The response includes the updated catalog entry and any slot-selection warnings. -
plugins.reload(operator.admin) reloads one or more discovered plugins with{ plugins: [{ pluginId, installHash?, sourceDigests? }], acknowledgeCapabilities? }, preserving configured enablement. Send 1–64 targets; a one-plugin request uses the same array envelope. The response containspluginIds,restartRequired: false, and a requiredruntimereceipt. -
plugins.refresh(operator.admin) refreshes plugin metadata and applies the resulting registry with{}. -
plugins.uninstall(operator.admin) removes one externally installed plugin with{ pluginId, keepFiles? }: config references, the install record, and managed files. Bundled plugins cannot be uninstalled, only disabled. The response lists the removal actions.
$include configurations without rewriting them.
Plugin lifecycle and Claw package removal requests return retryable UNAVAILABLE with retryAfterMs when another plugin or config operation is already applying. This busy response occurs before the requested mutation starts; retry after the current operation completes. Failures after a mutation starts retain their application details and are not automatically retryable.
These mutations wait for runtime application without restarting the Gateway. Successful responses include restartRequired: false and a runtime receipt with operationId, generation, pluginIds, and optional sourceDigests. The Gateway broadcasts plugins.changed with { generation } after publication. Runtime replacement errors include details.runtime.phase and details.runtime.committed, so clients can distinguish rejection before publication from failure after a new generation became active.
If a multi-step mutation publishes a runtime and later fails, details.runtime retains the published receipt with committed: true. A subsequent replacement that fails before publication is reported separately in details.runtimeAttempt. Clients should refresh their runtime view after any committed change, even when the overall mutation fails.
An install error can also include details.persistence: { operation: "install", pluginId }. This records that installation was saved, independently of runtime publication. Refresh the installed inventory and config; fix the reported problem and reload the installed plugin instead of blindly repeating installation. details.runtime.committed: false does not mean the installation was rolled back.
Install, enable, and reload may require capability consent. After reviewing the declared capabilities, pass acknowledgeCapabilities: { reviewToken }; the token is checked against a fresh inspection before application. This is separate from install-policy warning approval. See Plugin management.
Reload preconditions are optional. installHash is the lowercase SHA-256 of the canonical saved install record and requires a tracked package. sourceDigests maps resolved runtime plugin IDs to lowercase SHA-256 source digests. Tracked targets resolve their entire package; a bundled or configured source without an install record resolves its discovered runtime ID. Ambiguous, missing, or conflicting managed ownership still rejects the request. The Gateway checks target ownership and expected records before and after consent, then validates source expectations against the captured code it loads. Consent can update the saved install record: if that changes a supplied installHash, reload fails visibly without publishing runtime. The caller must refresh its expected state before retrying; the Gateway never rewrites the supplied hash. An acknowledgment covers its reviewed declared surface, and a different required surface stops the operation before runtime publication. Reload does not rebuild compiled bundled code or grant file-mutation authority.
sourceDigests requires a captured-source plugin instance and Node’s synchronous module hooks. Runtimes without those hooks, including Bun 1.4.2, omit these digests and reject requests that supply them. Ordinary Bun reloads capture fresh source for the replacement while retaining the old instance for admitted consumers; see runtime instance and source lifetime.
Messaging and logs
sendis the direct outbound-delivery RPC for channel/account/thread-targeted sends outside the chat runner.logs.tailreturns the configured gateway file-log tail with cursor/limit and max-byte controls.
Operator terminal
terminal.openstarts a host PTY for an explicitagentIdor the default agent and returns the resolved agent, working directory, shell, and confinement state. PassingsessionKeybinds the PTY to that exact agent session and attaches the calling connection as its first viewer; omitting it creates a connection-owned operator terminal.terminal.inputandterminal.resizeoperate on sessions owned by the calling connection and agent-owned sessions where that connection is an attached viewer.terminal.closekills a connection-owned session, but only detaches the calling viewer from an established agent-owned session. For a new session-bound Control UI terminal, the initiating viewer’s close or disconnect discards the PTY until the browser or exact-session agent first adopts it through an authorized operation.terminal.uploadaccepts one base64 file up to 16 MiB, stages it in a private 24-hour temporary directory on the session’s Gateway or paired-node host, and returns the absolute path. The caller must still paste or otherwise use that path; the RPC never writes terminal input or executes a command.terminal.dataandterminal.exitevents stream to the connection owner and attached viewers. Conversation-owned terminals remain persistent. The agent-facingterminaltool can list, read, resize, or close only terminals an operator opened for its exact session; it cannot open terminals. Agent input follows effective session and exec policy:full(YOLO) sends immediately,guardedandworkspace(including accept-only or Guardian-reviewed flows) require explicit one-time approval of that exact input, andread-onlyordenyblocks it.- Connection-owned sessions whose connection drops are detached, not killed: they stay reattachable for
gateway.terminal.detachedSessionTimeoutSeconds(default 300;0restores kill-on-disconnect) while recent output accumulates in a bounded server-side buffer. Established agent-owned sessions likewise survive viewer disconnect. terminal.listreturns attachable sessions.terminal.attachreturns the replay buffer and either rebinds a connection-owned session (tmux-style take-over — a previous live owner receivesterminal.exitwith reasondetached) or adds the connection as a viewer of an agent-owned session.- Every terminal method requires
operator.admin;gateway.terminal.enabledis on by default and refuses every method when set tofalse. Fully sandboxed agents are refused, and an agent policy change closes existing and in-flight PTYs, detached ones included.