Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

HTTP API

The awaken-server crate (feature flag server) exposes an HTTP API via Axum. Most responses are JSON. Streaming endpoints use Server-Sent Events (SSE).

This page mirrors the current route tree in crates/awaken-server/src/routes.rs and crates/awaken-server/src/config_routes.rs.

Health and metrics

MethodPathDescription
GET/healthReadiness probe. Checks store connectivity and returns 200 or 503
GET/health/liveLiveness probe. Always returns 200 OK
GET/metricsPrometheus scrape endpoint

Threads

MethodPathDescription
GET/v1/threadsList thread IDs
POST/v1/threadsCreate a thread. Body: { "title": "..." }
GET/v1/threads/summariesList thread summaries
GET/v1/threads/:idGet a thread by ID
PATCH/v1/threads/:idUpdate thread metadata
DELETE/v1/threads/:idDelete a thread
POST/v1/threads/:id/cancelCancel a specific queued or running job addressed by this thread ID. Returns cancel_requested.
POST/v1/threads/:id/decisionSubmit a HITL decision for a waiting run on this thread
POST/v1/threads/:id/interruptInterrupt the thread: bumps the thread generation, supersedes all pending queued jobs, and cancels the active run. Returns interrupt_requested with superseded_jobs count. Unlike /cancel, this performs a clean-slate interrupt via mailbox.interrupt().
PATCH/v1/threads/:id/metadataAlias for thread metadata updates
GET/v1/threads/:id/messagesList thread messages
POST/v1/threads/:id/messagesSubmit messages as a background run on this thread
POST/v1/threads/:id/mailboxPush a message payload to the thread mailbox
GET/v1/threads/:id/mailboxList mailbox jobs for the thread
GET/v1/threads/:id/runsList runs for the thread
GET/v1/threads/:id/runs/latestGet the latest run for the thread

Runs

MethodPathDescription
GET/v1/runsList runs
POST/v1/runsStart a run and stream events over SSE
GET/v1/runs/:idGet a run record
POST/v1/runs/:id/inputsSubmit follow-up input messages as a background run on the same thread
POST/v1/runs/:id/cancelCancel a run by run ID
POST/v1/runs/:id/decisionSubmit a HITL decision by run ID

Config and capabilities

These endpoints are exposed by config_routes(). Read and schema routes require AppState to be constructed with a config store. Mutation routes additionally require a config runtime manager so writes can validate and publish a new registry snapshot. Without the required config wiring, the routes return 400 with config management API not enabled.

MethodPathDescription
GET/v1/capabilitiesList registered agents, tools, plugins, models, providers, and config namespaces
GET/v1/config/:namespaceList entries in a config namespace
POST/v1/config/:namespaceCreate an entry; the body must contain "id"
GET/v1/config/:namespace/:idGet one config entry
PUT/v1/config/:namespace/:idReplace a config entry
DELETE/v1/config/:namespace/:idDelete a config entry
GET/v1/config/:namespace/$schemaReturn the JSON Schema for a namespace
GET/v1/agentsConvenience alias for /v1/config/agents
GET/v1/agents/:idConvenience alias for /v1/config/agents/:id

Current built-in namespaces:

  • agents
  • models
  • providers
  • mcp-servers

AI SDK v6 routes

MethodPathDescription
POST/v1/ai-sdk/chatStart a chat run and stream protocol-encoded events
POST/v1/ai-sdk/threads/:thread_id/runsStart a thread-scoped AI SDK run
POST/v1/ai-sdk/agents/:agent_id/runsStart an agent-scoped AI SDK run
GET/v1/ai-sdk/chat/:thread_id/streamResume an SSE stream by thread ID
GET/v1/ai-sdk/threads/:thread_id/streamAlias for stream resume by thread ID
GET/v1/ai-sdk/threads/:thread_id/messagesList thread messages
POST/v1/ai-sdk/threads/:thread_id/cancelCancel the active or queued run on a thread
POST/v1/ai-sdk/threads/:thread_id/interruptInterrupt a thread (bump generation, supersede pending jobs, cancel active run)

AG-UI routes

MethodPathDescription
POST/v1/ag-ui/runStart an AG-UI run and stream AG-UI events
POST/v1/ag-ui/threads/:thread_id/runsStart a thread-scoped AG-UI run
POST/v1/ag-ui/agents/:agent_id/runsStart an agent-scoped AG-UI run
POST/v1/ag-ui/threads/:thread_id/interruptInterrupt a thread
GET/v1/ag-ui/threads/:id/messagesList thread messages

A2A routes

MethodPathDescription
GET/.well-known/agent-card.jsonGet the public/default agent card
POST/v1/a2a/message:sendSend a message to the public/default A2A agent
POST/v1/a2a/message:streamStreaming send over SSE
GET/v1/a2a/tasksList A2A tasks
GET/v1/a2a/tasks/:task_idGet task status
POST/v1/a2a/tasks/:task_id:cancelCancel a task
POST/v1/a2a/tasks/:task_id:subscribeSubscribe to task updates over SSE
POST/v1/a2a/tasks/:task_id/pushNotificationConfigsCreate a push notification config
GET/v1/a2a/tasks/:task_id/pushNotificationConfigsList push notification configs
GET/v1/a2a/tasks/:task_id/pushNotificationConfigs/:config_idGet a push notification config
DELETE/v1/a2a/tasks/:task_id/pushNotificationConfigs/:config_idDelete a push notification config
GET/v1/a2a/extendedAgentCardGet the extended agent card; returns 501 unless enabled
POST/v1/a2a/:tenant/message:sendSend a message to a tenant-scoped agent
POST/v1/a2a/:tenant/message:streamTenant-scoped streaming send
GET/v1/a2a/:tenant/tasksList tasks for a tenant-scoped agent
GET/v1/a2a/:tenant/tasks/:task_idGet tenant-scoped task status
POST/v1/a2a/:tenant/tasks/:task_id:cancelCancel a tenant-scoped task
POST/v1/a2a/:tenant/tasks/:task_id:subscribeSubscribe to tenant-scoped task updates
GET/v1/a2a/:tenant/extendedAgentCardGet the tenant-scoped extended agent card

MCP HTTP routes

MethodPathDescription
POST/v1/mcpMCP JSON-RPC request/response endpoint
GET/v1/mcpReserved for MCP server-initiated SSE; currently returns 405

Common query parameters

  • offset — number of items to skip
  • limit — maximum items to return, clamped to 1..=200
  • cursor — message-history pagination cursor; when provided it takes precedence over offset, and history responses return next_cursor
  • status — run filter: running, waiting, or done
  • visibility — message filter: omit for external-only, set to all to include internal messages

Error format

Most route groups return:

{ "error": "human-readable message" }

MCP routes return JSON-RPC error objects instead of the generic shape above.