Integration Guide

Holon exposes an HTTP control plane for programmatic access. Start the server with holon serve and interact with agents, tasks, and work items through a REST-style API.

Starting the Server

# Local-only access
holon serve --port 8787

# With token-based authentication
holon serve --port 8787 --token "your-secret-token"

Access modes: local, tunnel, lan, tailnet.

API Conventions

Core Endpoints

Agent Management

MethodPathDescription
GET/agents/listList active agent entries with metadata
POST/control/agents/:agent_id/createCreate a new agent
GET/agents/:agent_id/statusGet agent status and lifecycle
GET/agents/:agent_id/stateGet full agent state snapshot

Messaging

MethodPathDescription
POST/agents/:agent_id/enqueueEnqueue a message into an agent
POST/control/agents/:agent_id/promptSend an operator prompt
POST/control/agents/:agent_id/wakeWake a sleeping agent
POST/control/agents/:agent_id/controlSend a control instruction

Tasks & Work Items

MethodPathDescription
POST/control/agents/:agent_id/tasksCreate a command task
POST/control/agents/:agent_id/work-itemsCreate a work item
POST/control/agents/:agent_id/work-items/:work_item_id/pickPick the current work item
PATCH/control/agents/:agent_id/work-items/:work_item_idUpdate a work item
POST/control/agents/:agent_id/work-items/:work_item_id/completeComplete a work item
GET/agents/:agent_id/tasksList agent tasks
GET/agents/:agent_id/briefsGet recent briefs/context
GET/agents/:agent_id/transcriptGet agent transcript
GET/agents/:agent_id/eventsGet agent event stream

Workspace & Skills

MethodPathDescription
POST/control/agents/:agent_id/workspace/attachAttach a workspace
POST/control/agents/:agent_id/workspace/detachDetach workspace
GET/agents/:agent_id/skillsList agent skills
POST/control/agents/:agent_id/skills/installInstall a skill

Callbacks & Webhooks

MethodPathDescription
POST/callbacks/enqueue/:callback_tokenExternal callback with payload
POST/callbacks/wake/:callback_tokenExternal wake trigger
POST/webhooks/generic/:agent_idGeneric webhook ingress

Runtime Control

MethodPathDescription
GET/control/runtime/statusRuntime health status
POST/control/runtime/shutdownGraceful shutdown

Examples

Send a message to an agent

curl -X POST http://localhost:8787/agents/my-agent/enqueue \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Review the latest changes in src/",
    "priority": "normal",
    "origin": {
      "kind": "operator",
      "actor_id": "my-service"
    }
  }'

Response:

{
  "ok": true,
  "agent_id": "my-agent",
  "message_id": "msg_abc123"
}

Create an agent

curl -X POST http://localhost:8787/control/agents/reviewer/create \
  -H "Content-Type: application/json" \
  -d '{"template": null}'

Check agent status

curl http://localhost:8787/agents/my-agent/status

Create a work item

curl -X POST http://localhost:8787/control/agents/my-agent/work-items \
  -H "Content-Type: application/json" \
  -d '{"objective": "Review and fix all clippy warnings"}'

Update and complete a work item

curl -X PATCH http://localhost:8787/control/agents/my-agent/work-items/work_123 \
  -H "Content-Type: application/json" \
  -d '{
    "plan_status": "ready",
    "todo_list": [
      { "text": "Run cargo check", "state": "completed" }
    ],
    "blocked_by": "waiting for CI",
    "recheck_after": 600000
  }'

curl -X POST http://localhost:8787/control/agents/my-agent/work-items/work_123/complete \
  -H "Content-Type: application/json" \
  -d '{}'

Create and cancel a timer

curl -X POST http://localhost:8787/control/agents/my-agent/timers \
  -H "Content-Type: application/json" \
  -d '{"duration_ms": 60000, "summary": "reminder"}'

curl -X POST http://localhost:8787/control/agents/my-agent/timers/timer_123/cancel \
  -H "Content-Type: application/json" \
  -d '{}'

Wake a sleeping agent

curl -X POST http://localhost:8787/control/agents/my-agent/wake \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "CI build completed",
    "source": "github-actions"
  }'

List agent tasks

curl http://localhost:8787/agents/my-agent/tasks

Get agent transcript

curl "http://localhost:8787/agents/my-agent/transcript?limit=50"

Trust & Provenance

Every inbound message carries an origin that classifies its source. The runtime uses this to enforce trust boundaries:

Messages also carry priority (interject, next, normal, background) and trust level metadata.

Operator Transport Bindings

For persistent integration channels, register an operator transport binding:

curl -X POST http://localhost:8787/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_token",
      "token": "my-delivery-token"
    },
    "capabilities": {
      "supports_interject": true,
      "supports_rich_text": true
    }
  }'

Once bound, use the operator ingress endpoint to relay messages:

curl -X POST http://localhost:8787/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"
  }'

See Also