On this page
HTTP control plane
Holon is designed to be headless. HTTP and event-driven integration surfaces should preserve the same runtime concepts as the CLI: origin, trust, priority, work items, tasks, queues, wakeups, and user-facing delivery.
The current generated OpenAPI baseline is checked in at
openapi.json. It is a conservative schema for the present
route surface; some request and response schemas intentionally remain broad
until the Phase 2 route/type metadata and DTO contracts are stabilized.
Authentication
When a control token is configured (e.g. --token, --token-file, or the
control_token config key), the HTTP server operates in bearer mode.
All /api/control/* routes require an Authorization: Bearer <token> header,
and read-only routes (agent state, events, tasks) require it for remote
access as well. Without a control token, the server runs in local mode
and trusts the local process boundary.
Daemon startup intent is persisted separately in
HOLON_HOME/daemon/serve_profile.json; it is not a live HTTP listener
configuration API. CLI overrides win over explicit startup environment inputs,
then the profile and defaults (validated legacy metadata is migration-only).
Startup diagnostics report these sources without token values.
The profile stores only a token-file path or an external_required marker, not
credentials. If saved authentication cannot be supplied, startup fails even on
loopback; it never silently downgrades to local unauthenticated mode.
Stop / runtime cleanup preserves this intent. See
Persistent serve options for reset, failure
and downgrade behavior.
Starting in v0.36.0, Holon supports a session-first authentication architecture. Browser and Web UI clients can authenticate using HTTP-only session cookies in addition to bearer tokens:
GET /api/auth/method— Returns current auth mode ("local"or"oidc").POST /api/auth/session/exchange— Exchange a bearer token for a revocable session credential and HTTP-only session cookie (primarily for browser/web clients).POST /api/auth/session/exchange/native— Exchange a static or bootstrap credential for a revocable session credential and native session response (used by native clients such as the Android app; retain the JSONcredentialand send it asAuthorization: Bearer <credential>).GET /api/auth/session/me— Inspect the authenticated user identity and authentication method.POST /api/auth/session/logout— Invalidate current session and clear session cookies.GET /api/auth/oidc/startandGET /api/auth/oidc/callback— Initiate and complete OpenID Connect PKCE authorization code flow whenauth.mode="oidc".POST /api/auth/:provider/device/start— Initiate OAuth device authorization flows (e.g. OpenAI Codex).POST /api/auth/pairing/issue— Issue a single-use pairing ticket (2-minute expiration) for browser and device handoff. Requires control token or valid session in local mode; rejected in OIDC mode.POST /api/auth/pairing/redeem— Redeem a pairing ticket for an HttpOnly browser session cookie.POST /api/auth/pairing/redeem/native— Redeem a pairing ticket for a revocable native session credential (used by Android and mobile clients).
For step-by-step IdP registration and session configuration, see Configure OIDC authentication.
Browser write protection
The /api and /apps boundaries apply an Origin/CSRF guard to unsafe
requests that rely on the ambient holon_session cookie. The request Origin
must match the request Host by scheme, host, and port, or match an exact
entry in api.csrf.trusted_origins. Missing Origin is fail-closed unless
the browser supplies Sec-Fetch-Site: same-origin or a same-origin Referer.
The guard is separate from CORS: CORS controls whether a browser may read a response, while this check controls whether a cross-origin browser may submit a cookie-authenticated write. Bearer-authenticated requests and trusted Unix control requests retain their existing behavior. Browser session exchange and pairing redemption remain protected even before a session cookie exists; native credential endpoints do not require browser-origin headers.
GET /api/handshake → { "auth": { "mode": "bearer" | "local", "required": bool } }
GET /api/auth/method → { "mode": "local" | "oidc" }
Ingress trust and auth boundaries
Holon treats authentication, message origin, trust level, priority, and authority as separate runtime facts. HTTP ingress handlers may authenticate a caller, but they still construct the message provenance explicitly instead of trusting caller-supplied provenance fields.
| Ingress class | Routes | Auth boundary | Origin/trust/authority | Priority | Supported posture |
|---|---|---|---|---|---|
| Public enqueue | POST /api/enqueue, POST /api/agents/:id/enqueue | Bearer token in bearer mode; local process boundary in local mode. | Caller may provide only channel or webhook origin. Caller-provided trust is rejected. Channel origins become untrusted external evidence; webhook origins become integration signals. Runtime-owned kinds such as system_tick and callback_event are rejected. | next, normal, or background; interject is rejected. | Candidate stable external ingress for non-operator evidence. |
| Callback capability | POST /api/callbacks/wake/:callback_token, POST /api/callbacks/enqueue/:callback_token | Capability token in the URL path resolves to an active external trigger and matching delivery mode. Do not log, repeat, or publish full callback URLs. | Delivery is admitted as an external-trigger capability and an integration signal. Wake callbacks enqueue runtime-owned inspection ticks; callback payload text is untrusted evidence for the agent to inspect. | Runtime-selected by delivery mode; callers do not choose queue priority. | Capability surface for durable external systems that need to wake or notify an agent. |
| Operator transport binding | POST /api/control/agents/:id/operator-bindings | Control-plane auth. Delivery credentials are stored on the binding and redacted from audit events. | Creates or updates the binding that later authorizes remote operator ingress. | N/A. | Experimental operator adapter setup surface. |
| Operator transport ingress | POST /api/control/agents/:id/operator-ingress | Control-plane auth plus active binding, matching target agent, matching operator actor, and matching provider when supplied. | Enqueues a trusted_operator operator_prompt with operator_instruction authority and remote-operator transport metadata. | Always interject. | Experimental authenticated operator adapter ingress. |
| Generic webhook compatibility | POST /api/webhooks/generic/:agent_id | Bearer token in bearer mode; local process boundary in local mode. | Converts JSON payload into a trusted-integration webhook event with generic_webhook origin. Callers cannot set origin, trust, or priority through this route. | Always normal. | Internal/debug compatibility route; prefer public enqueue or a dedicated capability callback for new external integrations. |
Endpoint reference
Discovery
GET /api/ — Root
Returns the default agent ID.
{ "ok": true, "default_agent": "main" }
GET /api/handshake — Protocol handshake
Returns auth mode, capabilities, and runtime info.
{
"ok": true,
"protocol": { "name": "holon-control", "version": 1 },
"auth": { "mode": "bearer", "required": true },
"capabilities": ["agents.list", "agents.state", "agents.events", "agents.control", "tui.remote"],
"runtime": {
"default_agent": "main",
"workspace_dir": "/path/to/workspace",
"home_dir": "/path/to/holon/home",
"listen": "127.0.0.1:7878",
"advertise_url": null
}
}
GET /api/models — Available models
Returns the cached model catalog and runtime availability without contacting providers.
POST /api/models/refresh — Refresh available models
Probes the providers you have opted into, even when their discovery cache is
still fresh, then returns the same catalog shape as GET /api/models. A
provider is opted in when it is declared with providers.<id> in
config.json, referenced from a configured model route, or targeted by an
earlier refresh in the current session. Opted-in credential-free and
anonymous-access built-in providers (such as ollama, vllm, and magpie)
serve their discovered models for the current session without changes to
config.json. A discovery failure for one provider does not prevent other
available models from being returned.
{
"available_models": [
{ "id": "claude-sonnet-4-20250514", "display_name": "Claude Sonnet 4", … }
],
"model_availability": { "claude-sonnet-4-20250514": true, … }
}
GET /api/models/providers — List resolved model providers
Returns the resolved provider projection (providers) along with the backing
discovery cache status (model_discovery_cache). Mirrors
holon config model-providers list and ListModelProviders.
operation(optional query):view_imageorgenerate_image. Restricts the list to providers that have at least one call-selectable model for that operation. Ignored wheninclude_unavailable=true.include_unavailable(optional query, defaultfalse): Diagnostic view that skips both availability andoperationfiltering.
GET /api/models/providers/:provider/models — List resolved models for a provider
Returns the resolved ProviderModelEntry list for one provider ID returned by
GET /api/models/providers, paged by model_ref cursor. Mirrors
holon config models list and ListProviderModels.
operation(optional query):view_imageorgenerate_image(ignored wheninclude_unavailable=true).include_unavailable(optional query, defaultfalse): Diagnostic view that skips availability andoperationfiltering.limit(optional query, default100, range1..=500): Maximum models returned per page; out-of-range values are clamped.cursor(optional query): Opaquemodel_refcursor returned innext_cursorby the preceding page.
Returns { provider, models, limit, returned, next_cursor }. Returns 404
with error code unknown_provider when the provider ID is unknown, and 400
with invalid_cursor when the cursor does not match a model in the filtered
sequence.
Agents
GET /api/agents/list — List agent entries
Returns lightweight public agent entries for selection and navigation without loading full per-agent runtime summaries.
GET /api/agents/:id/status — Single agent status
Returns the compact public agent status projection by default. Pass
detail=full to return the complete AgentSummary read model.
GET /api/agents/:id/state — Lightweight agent state bootstrap
Returns a bounded bootstrap page: agent summary, session info (current run, pending count), active task summaries, recent timers, slim work items, waiting intents, external triggers, and workspace occupancy. Operator notifications, execution details, task details, and full work item records are available from events or dedicated routes.
GET /api/agents/:id/model — Agent model read state
Returns the agent's model state (source, runtime default, effective/requested/active
routes, fallback chain, overrides, service tier, and resolved policy) without
building a full or compact agent summary. Unloaded agents read only persisted
model metadata without starting an agent runtime.
GET /api/agents/:id/briefs — Recent briefs
Returns recent briefs (acknowledgements and results) for the agent.
GET /api/agents/brief-read-states — All agent brief read states
Returns authoritative brief read cursors and exact unread counts across all visible public agents for the caller's principal and visibility scope. Used by web and mobile clients to keep unread badges synchronized.
GET /api/agents/:id/brief-read-state — Single agent brief read state
Returns the authoritative brief read cursor (read_through_event_seq), event head,
and unread count for the specified agent.
POST /api/agents/:id/brief-read-cursor — Advance brief read cursor
Monotonically advances the caller's brief read cursor for an agent. Requested cursors beyond the committed event head are clamped to that head. Request body:
{ "read_through_event_seq": 42 }
Returns MarkBriefReadResult containing applied_read_through_event_seq and the updated BriefReadState.
GET /api/agents/:id/tasks — Active tasks
Returns active and recent tasks with status, kind, and timing metadata.
GET /api/agents/:id/tasks/:task_id — Task status
Returns the structured task lifecycle snapshot for one managed task.
GET /api/agents/:id/tasks/:task_id/output — Task output
Returns a bounded task output result. Query parameters:
| Param | Description |
|---|---|
block | Whether to wait for output/completion before returning |
timeout_ms | Optional bounded wait duration when block=true |
GET /api/agents/:id/timers — Recent timers
Returns recent timer records.
GET /api/agents/:id/conversation — Conversation read-model summary
Returns conversation overview, current turn state, and visible message history.
GET /api/agents/:id/conversation/stream — Stream conversation updates
Server-sent events stream for active conversation turns, message streaming, and model thoughts.
GET /api/agents/:id/turns/:turn_id/activities — Turn activities detail
Returns fine-grained tool calls and internal activities for a specific conversation turn.
GET /api/agents/:id/timers/:timer_id — Timer detail
Returns a single timer record by id, or a shared error envelope when the timer is not found for the target agent.
GET /api/agents/:id/events — Event log
Returns recent runtime events (turn entries, system events). Query parameters:
| Param | Description |
|---|---|
before_seq | Return events with durable event_seq lower than this value |
after_seq | Return events with durable event_seq higher than this value |
limit | Max events to return (default 128) |
order | asc or desc (default) |
event_kind | Optional exact event-kind inclusion filter |
The JSON response is an EventsPageResponse:
| Field | Contract |
|---|---|
events | Array of full-payload StreamEventEnvelope records matching the optional event_kind filter |
oldest_seq / newest_seq | Lowest/highest durable event_seq in the returned page, or null for an empty page |
next_before_seq / next_after_seq | Exclusive scan continuation: last consumed candidate for descending/ascending pages respectively, only when the corresponding has_older / has_newer is true and the scan advanced; otherwise null |
cursor_seq | Raw event-log high-watermark captured while serving the page; clients can start the raw stream after this cursor |
has_older / has_newer | Whether more records remain before/after the page; in the scan direction, a budget-limited scan may conservatively report more candidates |
order | Echoes the requested order |
limit | Effective limit after server clamping |
before_seq and after_seq are exclusive cursors. When both are supplied, the
page contains events where after_seq < event_seq < before_seq. Event pages are
loaded from the durable event log, so an unknown cursor can yield an empty page
rather than a cursor error.
The scan and payload budgets can produce short or empty pages with a non-null
continuation. For order=desc, continue with before_seq=next_before_seq; for
order=asc, use after_seq=next_after_seq. Preserve the filter, order, and the
other bound. These cursors reflect consumed candidates, not returned event
boundaries or unconsumed lookahead. Do not stop solely because events is empty,
or substitute oldest_seq, newest_seq, or the SSE cursor_seq. Reject a
non-advancing continuation to avoid loops. The opposite-direction continuation
is always null; this does not imply its has_* flag is false. The
scan-direction continuation is null on exhaustion. Older responses may omit
these additive nullable fields.
Each page consumes at most 256 candidates after safe kind selection and 8 MiB of canonical JSON's original UTF-8 input bytes, admitted before hashing, JSON node traversal, and decoding. Exactly 8 MiB is allowed. Legacy/mismatched candidates still require canonical verification and count even if they do not match. A candidate that cannot fit the remaining budget is not consumed; a single unconsumed lookahead never advances continuation. These budgets do not bound total memory or wall-clock time.
If the first candidate exceeds the entire 8 MiB budget, the request fails with
HTTP 500, code=event_page_resource_exhausted, domain=runtime, and
retryable=false, using the existing error envelope without event content or
successful-page continuation. Do not automatically retry the same cursor.
Earlier pages can succeed, but that oversized record cannot currently be read
through this interface; it is not skipped, truncated, or admitted over budget.
GET /api/agents/:id/events/stream — Server-sent events
SSE stream of raw agent events. Supports after_seq and limit query params.
The SSE id field is the per-agent durable event_seq, and the
SSE event field is set to the raw audit event kind (e.g. turn_entry,
wake_requested, task_create_requested), not a limited set of names.
Each SSE data frame is a JSON StreamEventEnvelope with these stable fields:
| Field | Contract |
|---|---|
id | Audit event id. This is not the SSE frame id. |
event_seq | Per-agent durable sequence number; equal to the SSE id field |
ts | RFC 3339 timestamp |
agent_id | Agent that owns the event log |
type | Raw audit event kind; equal to the SSE event field |
provenance | Stable provenance fields extracted from the raw payload when present |
payload | Full event payload |
When after_seq is omitted, the stream starts after the current tail and only
emits future events. When after_seq=0, it replays from the beginning of the
current replay window. For non-zero after_seq, the cursor must still be inside
the replay window; otherwise the route returns 404 with code: cursor_not_found and after_seq/event_seq extension fields before opening
the SSE stream. If an already-open stream falls behind the replay window, the
server closes that stream. Clients must treat EOF as a possible gap signal,
fetch durable event pages after the last contiguous SSE id, and then reopen
the stream from the recovered high-watermark.
GET /api/events/stream is a live-only stream across public agents. It has
no global durable cursor or historical replay. If its receiver lags, the server
closes the stream; clients must backfill each affected agent from that agent's
last contiguous event_seq before reopening the global stream.
Filtering behavior:
- Event payloads are always included in full.
/api/agents/:id/eventsmay useevent_kindto select one raw event kind.- Pages and streams do not apply operator display levels; clients filter locally.
Migration note:
- This is a breaking event API change from the earlier projection contract.
Remove
projection=operatorandprojection=local_debugquery parameters. StreamEventEnvelope.projectionis no longer present. Clients that checkedprojection.raw_payload_includedshould treat all event envelopes as full-payload envelopes.- Remove server-side display-level query parameters. There is no compatibility period; unsupported query parameters are rejected.
- To reproduce operator-facing density, apply presentation filtering locally to
pages and to
/api/agents/:id/events/stream.
GET /api/agents/:id/transcript — Turn transcript
Returns the current turn transcript entries.
GET /api/agents/:id/worktree-summary — Worktree summary
Returns managed worktree entries for the agent's workspace.
Enqueue (public ingress)
POST /api/agents/:id/enqueue — Enqueue a message
Accepts external callers on the public HTTP surface. When the server is in
bearer mode, this route calls authorize_remote_access and requires the
control token just like read-only routes. In local mode no auth header is
needed.
The runtime classifies origin, trust, and priority; public callers may not
override trust or use interject priority.
Request shape:
{
"kind": "channel_event | webhook_event",
"priority": "next | normal | background",
"text": "plain text body",
"json": { "structured": "body" },
"body": { "type": "text", "text": "…" },
"origin": {
"kind": "channel",
"channel_id": "slack-general",
"sender_id": "U123"
},
"metadata": {},
"correlation_id": "optional-correlation",
"causation_id": "optional-causation"
}
Response:
{ "ok": true, "agent_id": "main", "message_id": "msg-abc123" }
POST /api/enqueue (no agent in path) — Enqueue to default agent.
POST /api/webhooks/generic/:agent_id — Generic webhook compatibility
Accepts a JSON payload and converts it to a webhook_event from
generic_webhook. This route is kept for local/debug compatibility and simple
trusted integration tests. It requires the bearer token when bearer mode is
enabled, but unlike public enqueue it does not let callers provide explicit
origin/trust/priority fields. New integrations should usually use public
enqueue for external evidence or a callback capability when the integration
needs a secret URL.
Control plane (authenticated)
All /api/control/* routes require a control token when the server is in bearer
mode.
POST /api/control/agents/:id/prompt — Send an operator prompt
Sends a prompt that enters the agent queue as an operator message with
trusted_operator classification.
{ "text": "What is the current status?" }
POST /api/control/agents/:id/wake — Explicit wake
Wakes a sleeping agent with a control-plane wake hint.
{ "reason": "manual-wake", "source": "operator" }
Response:
{ "ok": true, "agent_id": "main", "disposition": "woken" }
POST /api/control/agents/:id/control — Control action
Sends a control action. Request body:
{ "action": "stop", "authority_class": "operator_instruction" }
POST /api/control/agents/:id/current-run/abort — Abort current run
Aborts the current agent run loop. New callers should use
mode: "stop_after_abort". The legacy pause_after_abort value is accepted as
a compatibility alias and is treated as stop_after_abort.
{ "mode": "stop_after_abort" }
POST /api/control/agents/:id/create — Create agent
Creates a new agent managed by the host. The agent id comes from the URL path.
{ "template": null, "authority_class": "operator_instruction" }
Optional initial_response_language (BCP-47 tag or POSIX locale) is a one-time
hint for the language of the new agent's first default bootstrap reply. This
endpoint always creates the agent through the default bootstrap initialization
turn and rejects unknown request fields, so it accepts no explicit
initial_message and the hint always applies to that reply. The hint is stored
as runtime-owned bootstrap metadata; it never becomes an agent preference,
identity field, or persisted communication guidance, and unmapped values are
dropped rather than failing the request.
Creating an id whose deletion job fully completed starts a new incarnation
(identity.incarnation increments; the old state is never revived). While a
deletion is still in flight or failed, the request fails with
409 / deletion_incomplete.
GET /api/control/agents/tree — Agent hierarchy tree
Returns the full tree of agents, including public self-owned agents and supervised child subagents with lineage relations.
GET /api/control/agents/:id/detail — Canonical agent detail
Returns complete canonical projection for an agent: identity, display name, incarnation, configuration, model override, state, and lineage.
PATCH /api/control/agents/:id/name — Rename agent display name
Updates the display name of a public self-owned agent. The canonical agent_id remains unchanged.
{ "name": "Lead Reviewer" }
POST /api/control/agents/:id/repair — Repair agent bootstrap
Retries incomplete post-create bootstrap steps (template files, workspace binding, initial message) without recreating the agent identity.
DELETE /api/control/agents/:id — Permanently delete agent
Schedules asynchronous deletion of an agent and its data. Pass ?cascade_private_children=true to delete private subagents. Returns a deletion job handle.
GET /api/control/agents/:id/delete-status — Query deletion job status
Returns the current identity and deletion job (pending, running,
retryable_failed, needs_attention, completed, or abandoned). When a job
stops in needs_attention, inspect job.required_input for the operator
decision needed.
POST /api/control/agents/:id/deletion/resolve — Resolve a stopped deletion
Resolves an agent deletion job stopped in needs_attention. The only supported
decision is "abandon", which marks the deletion job abandoned, returns the
agent identity to Active, and returns any remaining manual cleanup scope.
{ "decision": "abandon" }
POST /api/control/agents/:id/timers — Create timer
Creates a persistent delayed or recurring timer for the agent.
{ "duration_ms": 60000, "interval_ms": null, "title": "Heartbeat", "instruction": "Run health check" }
POST /api/control/agents/:id/timers/:timer_id/pause — Pause timer
Pauses an active timer by id without removing its schedule or waits.
POST /api/control/agents/:id/timers/:timer_id/resume — Resume timer
Resumes a paused timer by id.
POST /api/control/agents/:id/timers/:timer_id/cancel — Cancel timer
Cancels an active timer by id.
POST /api/control/agents/:id/tasks — Create command task
Starts a background command task for the agent.
{
"summary": "Build project",
"cmd": "cargo build",
"workdir": null,
"shell": null,
"login": false
}
POST /api/control/agents/:id/tasks/:task_id/input — Send task input
Delivers text input to a managed task using trusted operator authority. Command tasks receive stdin or TTY text when they were created with interactive input enabled; supervised child-agent tasks receive a follow-up input.
{ "text": "continue\n", "authority_class": "operator_instruction" }
POST /api/control/agents/:id/tasks/:task_id/stop — Stop task
Requests cancellation for a managed task and returns the structured task stop receipt.
{ "authority_class": "operator_instruction" }
POST /api/control/agents/:id/work-items — Create work item
Creates a durable work item for the agent.
{
"objective": "Fix the build",
"authority_class": "operator_instruction"
}
POST /api/control/agents/:id/work-items/:work_item_id/pick — Pick work item
Makes an existing open work item the current focus for the agent. The response returns the previous focus, current focus, current work item id, and the recorded focus transition.
{ "reason": "external scheduler selected next work", "authority_class": "integration_signal" }
PATCH /api/control/agents/:id/work-items/:work_item_id — Update work item
Mutates one or more WorkItem fields. Empty updates are rejected. blocked_by is
descriptive only (a string sets the note, null clears it, and omitting leaves
it unchanged) and does not pause or resume scheduling. Passing recheck_after
(including null) is rejected with 400 Bad Request; use WaitFor with
recheck_after_ms instead.
{
"objective": "Fix the build and update docs",
"plan_status": "ready",
"todo_list": [{ "text": "Run cargo check", "state": "completed" }],
"blocked_by": "waiting for CI",
"authority_class": "operator_instruction"
}
POST /api/control/agents/:id/work-items/:work_item_id/complete — Complete work item
For an open work item, atomically persists the supplied report as the canonical
result brief, binds the completion intent, applies completion scheduling side
effects, and returns the WorkItemRecord in the completed state. The same
endpoint also finalizes an existing legacy completing record. Empty reports,
cancel, close-without-completion, and delete are intentionally out of scope for
this lifecycle surface.
{
"report_text": "Build fixed and all checks passed.",
"authority_class": "operator_instruction"
}
POST /api/control/agents/:id/timers — Create timer
Creates a timer that will deliver a TimerTick to the agent.
{
"duration_ms": 60000,
"interval_ms": null,
"title": "Heartbeat",
"instruction": "reminder",
"authority_class": "operator_instruction"
}
summary remains accepted as a legacy alias for instruction (do not send both).
PATCH /api/control/agents/:id/timers/:timer_id — Edit timer title or instruction
Partially updates title and/or instruction (or legacy summary; null clears)
on an active or paused timer without changing its schedule or wakes already queued.
POST /api/control/agents/:id/timers/:timer_id/pause — Pause timer
Pauses an active timer and returns the updated TimerRecord (status: "paused",
next_fire_at: null, and paused_remaining_ms frozen for non-calendar timers).
Idempotent for an already-paused timer. Missing timers return 404; completed
or cancelled timers return 409 Conflict. Pausing does not stop wakes already
queued or claimed.
POST /api/control/agents/:id/timers/:timer_id/resume — Resume timer
Resumes a paused timer and returns the updated TimerRecord (status: "active").
Calendar timers pick the next valid occurrence after resume time; relative and
interval timers continue from paused_remaining_ms. Missed runs are not
replayed. Idempotent for an already-active timer; completed or cancelled timers
return 409 Conflict.
POST /api/control/agents/:id/timers/:timer_id/cancel — Cancel timer
Cancels an active or paused timer and returns the updated TimerRecord.
Cancellation is idempotent for an already-cancelled timer. A missing timer returns
a shared 404 error envelope; a completed timer returns a shared 400 lifecycle
error because it already fired. Cancellation immediately updates timer list/detail
projections and emits timer_cancelled.
{ "authority_class": "operator_instruction" }
POST /api/control/agents/:id/debug-prompt — Debug prompt
Sends a debug-mode prompt (runtime-internal classification). Request body:
{ "text": "debug instruction", "authority_class": "operator_instruction" }
GET /api/agents/:id/turns/:turn_id/deletion-preview — Preview turn content deletion
Returns the scope preview before deleting recorded conversation content for a turn.
DELETE /api/agents/:id/turns/:turn_id/content — Delete turn content
Deletes stored conversation content for a settled turn (optionally guarded by
?expected_revision=<N>). Deleted turn content is withheld from transcript,
event, and export reads.
POST /api/agents/:id/messages/:message_id/withdraw — Withdraw unexecuted input
Withdraws an operator-submitted queued message before it has been claimed for
execution. Already-claimed or non-operator messages fail with 409 Conflict.
POST /api/control/agents/:id/operator-bindings — Create operator transport binding
Sets up a callback URL or transport binding for operator notifications. Request body:
{
"binding_id": "my-binding",
"transport": "http-callback",
"operator_actor_id": "operator-1",
"default_route_id": "default",
"delivery_callback_url": "https://example.com/callback",
"delivery_auth": { "type": "bearer", "token": "secret" },
"capabilities": { "send_prompt": true },
"provider": "anthropic",
"provider_identity_ref": "user-123",
"metadata": {}
}
POST /api/control/agents/:id/operator-ingress — Operator ingress
Direct ingress path for operator-origin messages through the control plane. Request body:
{
"text": "operator message",
"actor_id": "operator-1",
"binding_id": "my-binding",
"reply_route_id": "route-1",
"provider": "anthropic",
"correlation_id": "corr-123"
}
POST /api/control/agents/:id/workspace/attach — Attach workspace
{ "path": "/path/to/workspace" }
POST /api/control/agents/:id/workspace/exit — Exit current workspace
Returns to the agent home workspace. Accepts an optional body:
{ "authority_class": "operator_instruction" }
POST /api/control/agents/:id/workspace/detach — Detach workspace
Removes a workspace registration without switching. Request body:
{ "workspace_id": "ws-abc123", "authority_class": "operator_instruction" }
POST /api/control/agents/:id/model — Set agent model
{ "model": "claude-sonnet-4-20250514" }
POST /api/control/agents/:id/model/clear — Clear model override
Reverts to the default model. Accepts an optional body:
{ "authority_class": "operator_instruction" }
GET /api/control/agents/:id/external-triggers — List external triggers
Read-only diagnostic list of retained active and revoked external triggers for
the agent. Supports cursor pagination (limit 1–100, default 20; cursor) and
an optional exact 16-lowercase-hex fingerprint filter. Returns trigger
metadata and token_fingerprint only; plain-text tokens, full hashes, and
callback URLs are never returned by this route.
POST /api/control/agents/:id/external-triggers/:external_trigger_id/reveal — Reveal active external trigger token
Reads the stored plain-text callback token and trigger_url for one active
external trigger. Requires the independent static control token credential;
trusted-local admission, browser sessions, and bearer session credentials are
rejected. Responses include Cache-Control: no-store. Returns 404 when the
agent or trigger does not exist, 409 trigger_not_active when revoked, and
409 token_unavailable when no stored token verifies against its hash.
GET /api/control/agents/:id/acp-interactions — List pending ACP interactions
Lists pending permission and elicitation prompts waiting for operator input on a
loaded acp-driver agent (agent_id and interactions). A loaded agent with no
pending interactions returns an empty array; sleeping agents are not woken by
this request.
POST /api/control/agents/:id/acp-interactions/:interaction_id — Resolve pending ACP interaction
Resolves one pending ACP permission or elicitation request.
- Permission decisions use
decision(allow_once,allow_always,reject_once, orreject_always):
{ "decision": "allow_once" }
- Elicitation responses use
action(accept,decline, orcancel), with optional formcontentwhen accepting:
{ "action": "accept", "content": { "answer": "yes" } }
Returns 200 with {"agent_id": "...", "interaction_id": "...", "resolved": true}.
Returns 400 for an invalid body, 404 when the agent or interaction ID is
unknown, and 409 with settled_reason (timed_out, cancelled, or
resolved) if the interaction already settled; late replies never grant authority
after a timeout fallback.
GET /api/control/network/tailscale/serve — Tailscale Serve status
Returns current Tailscale Serve status, target loopback port, and the active tailnet domain when configured. control_authentication_available indicates effective TCP control authentication without exposing credentials; disabled authentication does not qualify.
POST /api/control/network/tailscale/serve/enable — Enable Tailscale Serve
Enables Tailscale Serve to expose the local HTTP control plane securely over HTTPS on your tailnet. Effective control authentication and a listener including loopback are required before a rule is changed; LAN access is not required.
POST /api/control/network/tailscale/serve/disable — Disable Tailscale Serve
Disables Tailscale Serve sharing.
Local Apps
Holon can host static HTML/JS applications stored in an agent's agent_home/apps/<app-id>/ directory. Apps are addressed through logical /apps routes rather than direct filesystem paths.
GET /apps/:agent_id — Discover agent apps
Returns the valid apps owned by the specified agent in an apps array (alongside agent_id). Each app entry includes its manifest metadata and root url. Each app must contain a valid manifest.json.
GET /apps/:agent_id/:app_id or GET /apps/:agent_id/:app_id/ — Serve app entry document
Serves the app entry HTML document declared in manifest.json. Served with Cache-Control: no-store, X-Content-Type-Options: nosniff, and a restrictive Content Security Policy.
GET /apps/:agent_id/:app_id/context — App SDK context
Returns runtime metadata for the hosted app:
{
"sdk_version": "1",
"agent_id": "main",
"app_id": "dashboard",
"session": { "authenticated": true }
}
POST /apps/:agent_id/:app_id/request — Send app request
Enqueues a structured app request to the agent queue:
{
"version": "1",
"request_type": "refresh_data",
"payload": { "force": true },
"request_id": "req-123"
}
GET /apps/:agent_id/:app_id/events — Stream app events
Streams app-originated lifecycle events via Server-Sent Events (SSE).
GET /apps/:agent_id/:app_id/holon.js — Browser App SDK
Serves the built @holon/app-sdk client artifact exposing window.Holon.
GET /apps/:agent_id/:app_id/:asset_path — Serve static asset
Serves allowlisted static assets (JS, CSS, images, fonts) within the app root directory. Path traversal attempts and symlinks pointing outside the app root are rejected.
Runtime management
GET /api/control/runtime/status — Runtime status
Returns daemon and runtime health info including configured models, control token status, and activity markers.
GET /api/control/runtime/config — Runtime config
Returns config_file_path, the daemon's current effective runtime_surface,
live reload generation status, and setup readiness state.
PATCH /api/control/runtime/config — Update runtime config
Validates and persists a batch of runtime-mutable config updates ("key" with
either "value" or "unset": true). If any entry is unsupported, startup-only,
or invalid, or if the resulting configuration fails validation, the whole batch
is rejected ("changed": false, all entries rejected, and config.json
left untouched).
Accepted updates write config.json, schedule a live configuration reload, and
report accepted_reload_scheduled (runtime.db_readers.* keys instead report
accepted_requires_restart). The response's runtime_surface still reflects
the pre-reload snapshot; poll GET /api/control/runtime/config until
reload.completed_generation catches up to reload.requested_generation.
To declare a new custom provider over this endpoint, include both
providers.<id>.transport and a valid providers.<id>.base_url in the same
batch (in any order) for an <id> that is neither in config.json nor a
built-in provider. Omitting base_url rejects the batch, and other
providers.<id>.* keys alone still fail for unknown IDs.
{
"updates": [
{ "key": "model.default", "value": "openai@default/gpt-5.4" }
]
}
{
"ok": true,
"changed": true,
"config_file_path": "/path/to/holon-home/config.json",
"results": [
{
"key": "model.default",
"effect": "accepted_reload_scheduled",
"reason": "persisted in config.json; reload generation 1 scheduled"
}
],
"runtime_surface": { "...": "..." },
"reload": { "requested_generation": 1, "completed_generation": 0, "state": "applying" },
"setup": { "status": "blocked", "default_model": "openai@default/gpt-5.4", "provider": "openai", "actions": [] }
}
POST /api/control/runtime/shutdown — Graceful shutdown
Shuts down the runtime and daemon gracefully.
GET /api/control/runtime/metrics — Performance diagnostics snapshot
Returns runtime performance metrics in standard OpenMetrics text format (application/openmetrics-text; version=1.0.0; charset=utf-8). Useful for Prometheus and operational monitoring.
GET /api/control/runtime/traces — Recent trace summaries
Returns recent runtime trace activity and spans for latency diagnosis.
Workspace & Desktop integration
POST /api/file-references/resolve — Batch resolve file references
Resolves up to 64 file references (workspace_uri, absolute_path, or relative_path relative to a known base file) into canonical workspace file locations. Requires remote access authorization.
Request:
{
"references": [
{
"type": "workspace_uri",
"workspace_uri": "workspace://ws_f375c191f64f3dd/src/main.rs"
},
{
"type": "absolute_path",
"absolute_path": "/home/user/project/README.md"
}
]
}
Response:
{
"results": [
{
"status": "resolved",
"location": {
"workspace_id": "ws_f375c191f64f3dd",
"execution_root_id": "root_c8010df5",
"path": "src/main.rs",
"absolute_path": "/home/user/project/src/main.rs",
"kind": "file",
"root_kind": "canonical"
}
},
{
"status": "unresolved",
"reason": "unknown_workspace",
"message": "workspace not found"
}
]
}
GET /api/desktop/capabilities — Desktop integration capabilities
Returns the daemon host's desktop capability (such as macOS Finder reveal). This requires --desktop-integration enabled and running on macOS, independent of LAN/Serve or caller locality. The Web UI hides the action outside localhost/loopback entry points; this is not an API permission boundary.
{
"reveal_in_finder": true
}
POST /api/desktop/reveal — Reveal file in desktop file manager
Reveals the specified file or directory in the daemon host's macOS Finder, not the caller's device. Authorized remote calls are allowed when desktop integration is enabled, the desktop Origin/cross-site checks pass, and the path stays strictly within the registered workspace execution root.
{
"workspace_id": "ws_f375c191f64f3dd",
"execution_root_id": "root_c8010df5",
"path": "src/main.rs"
}
Webhooks & callbacks
POST /api/webhooks/generic/:agent_id — Generic webhook
Accepts arbitrary JSON payloads and enqueues them as WebhookEvent messages
to the named agent. Useful for GitHub webhooks, CI notifications, and external
service integrations.
POST /api/callbacks/enqueue/:callback_token — Callback enqueue
Receives enqueue callbacks from registered callback URLs. Body limit: 256 KB.
POST /api/callbacks/wake/:callback_token — Callback wake
Receives wake callbacks from registered callback URLs.
Message shapes
MessageKind
Valid enqueue kinds for external callers: channel_event, webhook_event.
The policy only allows operator_prompt with an operator origin; public
enqueue rejects it. Runtime-owned kinds (system_tick, task_result,
task_status, control, internal_followup) are rejected from
external enqueue.
Priority
| Value | Behavior |
|---|---|
interject | Preempts normal queue; control-plane only |
next | After current turn, before queued |
normal | Standard queue position |
background | Low urgency, processed when idle |
TrustLevel
| Value | Default origin | Meaning |
|---|---|---|
trusted_operator | operator | Direct operator action |
trusted_system | system, task, timer | Runtime-internal action |
trusted_integration | webhook, callback | Known integration with explicit trust |
untrusted_external | channel | Public channel / unauthenticated caller |
MessageOrigin
| Kind | Fields |
|---|---|
operator | actor_id (optional) |
channel | channel_id, sender_id (optional) |
webhook | source, event_type (optional) |
callback | descriptor_id, source (optional) |
timer | timer_id |
system | subsystem |
task | task_id |
MessageBody
| Type | Fields |
|---|---|
text | text: string |
json | value: object |
brief | title, text, attachments |
Design goals
- Keep transport details outside the core runtime model.
- Preserve provenance for inbound messages and external events.
- Return structured lifecycle state rather than only streaming text.
- Make wake, sleep, enqueue, and task supervision visible to integrations.
- Keep user-facing output separate from internal traces.
Integration posture
Treat the HTTP surface as a control plane for runtime state, not a chat-only endpoint. A good integration should be able to ask:
- What work is active?
- Which tasks are running or waiting?
- What event woke the agent?
- Which output is safe to show to a user?
- Which evidence is internal runtime detail?
Routes not yet documented
The following routes exist in crates/holon-http-api/src/http/mod.rs but are not yet fully documented
on this reference page:
GET /api/agents/:id/skillsPOST /api/control/agents/:id/skills/installPOST /api/control/agents/:id/skills/uninstall- Default-agent aliases:
/api/status,/api/briefs,/api/state,/api/transcript,/api/worktree-summary
These will be added as the surface stabilizes.
Common curl examples
# Check server health
curl http://127.0.0.1:7878/api/handshake
# List agents
curl http://127.0.0.1:7878/api/agents/list
# Get agent state
curl http://127.0.0.1:7878/api/agents/main/state
# Send a prompt (control token required)
curl -X POST http://127.0.0.1:7878/api/control/agents/main/prompt \
-H "Authorization: Bearer $HOLON_CONTROL_TOKEN" \
-H "Content-Type: application/json" \
-d '{"text": "Run cargo check"}'
# Enqueue via webhook (public)
curl -X POST http://127.0.0.1:7878/api/webhooks/generic/main \
-H "Content-Type: application/json" \
-d '{"event": "ci-complete", "status": "success"}'
# Stream agent events
curl -N http://127.0.0.1:7878/api/agents/main/events/stream
Operator Transport Bindings
For persistent integration channels, register an operator transport binding:
curl -X POST http://localhost:8787/api/control/agents/my-agent/operator-bindings \
-H "Content-Type: application/json" \
-d '{
"transport": "http_callback",
"operator_actor_id": "slack-bot-01",
"default_route_id": "slack-channel-general",
"delivery_callback_url": "https://my-service.example.com/holon-delivery",
"delivery_auth": {
"kind": "bearer",
"bearer_token": "my-delivery-token"
},
"capabilities": {
"text": true,
"markdown": true
}
}'
Once bound, use the operator ingress endpoint to relay messages:
curl -X POST http://localhost:8787/api/control/agents/my-agent/operator-ingress \
-H "Content-Type: application/json" \
-d '{
"text": "User asked: can you explain the build error?",
"actor_id": "slack-bot-01",
"binding_id": "binding-abc"
}'
