API Reference
JSON-RPC API Complete method reference for the WebSocket JSON-RPC 2.0 interface
This page is a compact quick-reference for every JSON-RPC method exposed by the Aleph Gateway. For detailed request/response examples, follow the links to the individual method pages.
All methods are invoked over a WebSocket connection to the Gateway server (default ws://127.0.0.1:18790). The protocol is JSON-RPC 2.0 -- every request requires jsonrpc, method, and id fields. Notifications (no id) are used for server-to-client events.
{
"jsonrpc" : "2.0" ,
"id" : 1 ,
"method" : "agent.run" ,
"params" : { "message" : "Hello" }
}
When require_auth is enabled in the Gateway config, the first message on a new WebSocket connection must be connect. All subsequent requests are rejected until authentication succeeds.
Method Description Parameters connectAuthenticate a WebSocket connection token (string), client_id (string, optional)
Full documentation
Method Description Key Parameters Returns agent.runStart an agent run with streaming message, session_key?, thinking?, model?{ run_id, status, session_key }agent.cancelCancel a running agent run_id{ cancelled, run_id }agent.statusGet run status (polling) run_id{ run_id, status, iterations, tokens_used }agent.listList available agent configurations -- { agents[] }agent.respondToInputSend follow-up input to a waiting run run_id, message{ queued }
Full documentation
Method Description Key Parameters Returns session.listList sessions with filters filter?, limit?, offset?{ sessions[], total }session.historyGet raw message history session_key, limit?{ messages[], token_count }session.compactTrigger manual compaction session_key{ tokens_before, tokens_after, facts_extracted }session.deletePermanently delete a session session_key{ deleted, messages_removed }
Full documentation
Method Description Key Parameters Returns config.getGet active configuration -- { config, source, loaded_at }config.reloadReload from disk -- { reloaded, changed_keys }config.validateValidate without applying config{ valid, errors[], warnings[] }config.schemaGet configuration JSON Schema -- JSON Schema object
Full documentation
Method Description Key Parameters Returns exec.approval.requestRequest command approval command, cwd, agent_id, timeout_ms?{ id, approved, decision }exec.approval.resolveResolve a pending approval id, decision, resolved_by?{ resolved }exec.approvals.getGet approval configuration -- { config, hash }exec.approvals.setUpdate approval config config, base_hash{ applied }exec.approvals.pendingList pending approvals -- { pending[] }
Full documentation
Method Description Key Parameters Returns events.subscribeSubscribe to event topics patterns[]{ subscribed[], active_patterns[] }events.unsubscribeRemove subscriptions patterns[]{ unsubscribed[], active_patterns[] }events.listList active subscriptions -- { patterns[], total }
Full documentation
Method Description Key Parameters Returns wizard.startStart a wizard session wizard_type, initial_data?{ session_id, step, status }wizard.answerAnswer current step session_id, step_id, value{ done, step?, status }wizard.nextAdvance past informational step session_id{ done, step?, status }wizard.cancelCancel a wizard session_id{ cancelled }wizard.statusGet wizard status session_id{ status }
Full documentation
Method Description Key Parameters Returns cron.createCreate a scheduled job name, schedule, agent_id, prompt{ job_id, next_run_at }cron.listList all jobs filter?{ jobs[], total }cron.getGet job details + run history job_idJob object with recent_runs[] cron.deleteDelete a job job_id{ deleted }cron.triggerManually trigger a job job_id{ triggered, run_id }cron.pausePause a job job_id{ paused }cron.resumeResume a paused job job_id{ resumed, next_run_at }cron.statusGet scheduler status -- Scheduler state
Full documentation
Method Description Key Parameters Returns browser.navigateNavigate to a URL url, wait_until?, timeout_ms?{ url, title, status }browser.clickClick an element target (ActionTarget){ clicked }browser.typeType text into an element target, text, clear?{ typed }browser.screenshotCapture a screenshot target?, full_page?, format?{ data_base64, width, height }browser.evaluateExecute JavaScript script, timeout_ms?{ value, type }browser.snapshotTake ARIA accessibility snapshot -- { elements[], page_title }
Method Description Key Parameters Returns chat.sendSend a chat message message, session_key?Run info chat.abortAbort current chat generation run_id?{ aborted }chat.historyGet chat history session_key?, limit?{ messages[] }chat.clearClear chat history session_key?{ cleared }
Method Description Key Parameters Returns models.listList available models -- { models[] }models.getGet model details model_idModel metadata models.capabilitiesGet model capabilities model_idCapability flags
Method Description Key Parameters Returns memory.searchSearch stored memories query, limit?{ results[] }
Method Description Key Parameters Returns skills.listList installed skills -- { skills[] }skills.installInstall a skill name, sourceInstall result
Method Description Key Parameters Returns plugins.listList installed plugins -- { plugins[] }plugins.loadLoad a plugin into runtime path{ loaded }plugins.unloadUnload a plugin plugin_id{ unloaded }plugins.enableEnable a plugin plugin_id{ enabled }plugins.disableDisable a plugin plugin_id{ disabled }plugins.statusGet plugin status plugin_idPlugin status
Method Description Key Parameters Returns services.listList background services -- { services[] }services.startStart a service name{ started }services.stopStop a service name{ stopped }services.statusGet service status name{ status }
Method Description Key Parameters Returns mcp.list_pending_approvalsList pending MCP approvals -- { approvals[] }mcp.respond_approvalRespond to an MCP approval id, approved{ responded }mcp.cancel_approvalCancel an MCP approval id{ cancelled }
Method Description Key Parameters Returns markdown_skills.loadLoad a markdown skill path{ loaded }markdown_skills.reloadReload a skill name{ reloaded }markdown_skills.listList loaded skills -- { skills[] }markdown_skills.unloadUnload a skill name{ unloaded }
Method Description Key Parameters Returns poe.runRun a POE task spec, agent_id?{ run_id }poe.statusGet POE run status run_id{ status, progress }poe.cancelCancel a POE run run_id{ cancelled }poe.listList POE runs -- { runs[] }poe.preparePrepare a POE contract spec{ contract_id, terms }poe.signSign a POE contract contract_id{ signed }poe.rejectReject a POE contract contract_id{ rejected }poe.pendingList pending contracts -- { contracts[] }
Method Description Key Parameters Returns identity.getGet current identity -- Identity object identity.setSet identity fields fields{ updated }identity.clearReset to default identity -- { cleared }identity.listList available identities -- { identities[] }
Method Description Key Parameters Returns workspace.createCreate a workspace name, config?{ workspace_id }workspace.listList workspaces -- { workspaces[] }workspace.getGet workspace details workspace_idWorkspace object workspace.updateUpdate workspace config workspace_id, config{ updated }workspace.archiveArchive a workspace workspace_id{ archived }
Method Description Key Parameters Returns guests.createInvitationCreate a guest invitation permissions, expires?{ invitation_id, token }guests.listPendingList pending invitations -- { invitations[] }guests.revokeInvitationRevoke an invitation invitation_id{ revoked }
Method Description Key Parameters Returns healthHealth check -- { status: "ok" }echoEcho back params any Echoed params versionGet server version -- { version, build }logs.levelsGet current log levels for all components -- { levels }logs.set_levelSet log level for a component component, level{ set }logs.tailStream recent log entries lines?, follow?{ entries[] }commands.listList all registered commands -- { commands[] }
Standard JSON-RPC 2.0 error codes plus Aleph extensions:
Code Constant Description -32700PARSE_ERRORInvalid JSON -32600INVALID_REQUESTMalformed JSON-RPC request -32601METHOD_NOT_FOUNDMethod does not exist -32602INVALID_PARAMSInvalid method parameters -32603INTERNAL_ERRORInternal server error -32000AUTH_REQUIREDAuthentication required (send connect first) -32001AUTH_FAILEDAuthentication credentials rejected -32002PERMISSION_DENIEDInsufficient permissions -32003RATE_LIMITEDToo many requests -32004RESOURCE_NOT_FOUNDRequested resource not found -32005TIMEOUT_ERROROperation timed out -32006TOOL_ERRORTool execution failed
Error response format:
{
"jsonrpc" : "2.0" ,
"id" : 1 ,
"error" : {
"code" : -32601 ,
"message" : "Method not found: agent.nonexistent"
}
}
Events are delivered as JSON-RPC notifications (no id field) to subscribed clients. Subscribe via events.subscribe.
Topic Pattern Description stream.startAgent response streaming begins stream.chunkText chunk from agent stream.tool_startTool invocation started stream.tool_endTool execution completed stream.thinkingReasoning step (CoT) stream.endStreaming finished agent.startedAgent run started agent.completedAgent run finished agent.errorAgent run failed agent.cancelledAgent run cancelled session.createdNew session created session.deletedSession deleted session.compactedSession compacted config.changedConfiguration modified config.reloadedConfig reloaded from file cron.triggeredCron job triggered cron.completedCron job completed cron.failedCron job failed exec.approval_requestedApproval needed for command exec.approval_resolvedApproval decision made