Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

HTTP API

The agent server's inbound HTTP surface: auth, health, autonomous trigger, webhooks, tool-event injection, routine graph, and the conversation API.

Context — The agent server's complete inbound HTTP surface for runtime version 0.21.8. Conversation traffic is normally driven through the SDK (Integrating the SDK); this page is the wire-level contract.

Authentication

Paths
Auth

/health/*, /health

none

/webhooks/{name}

HMAC signature over the raw body (per-webhook config)

/auth/login, /auth/logout

none (the login flow itself)

everything else

Authorization: Bearer <agent api key> (constant-time compared against the manifest's runtime.api_key), or the agent_auth cookie (below)

Failed bearer auth returns 401. Failed HMAC verification returns 401 with no detail; unknown webhook names return 404 indistinguishable from unconfigured ones.

Browser cookie login — for the built-in chat UI (GET /chat), where a browser can't attach an Authorization header to the UI's own requests: an unauthenticated browser navigation redirects to GET /auth/login; POST /auth/login validates the typed-in agent api key and sets an HttpOnly agent_auth cookie carrying the same key, which the browser replays on every same-origin call; POST /auth/logout clears it. Server-to-server integrations should keep using the bearer header.

Health

Method & path
Response

GET /health/live

always 200 {"status": "ok", "service": "agent-server"} — liveness

GET /health/ready

200 after configuration and graph publication, 503 {"status": ...} while booting — readiness

GET /health

alias of /health/ready

Readiness waits for boot-time routine evaluation and graph publication — see the boot sequence.

Maintenance garbage collection

POST /maintenance/gc (no request body) uses the existing agent authentication. Pause and drain all work and stop all other replicas before calling. The endpoint does not verify those maintenance conditions or provide a separate operator role.

200: {"deleted": {"routines": 2, "glossary": 3}, "errors": {}}. Counts cover completed store sweeps. 500 returns the same shape with failed stores in errors; those stores may have partially deleted rows and have no count. 409 means storage is not PostgreSQL; 503 means the agent is not ready or its deployment inventory is unavailable.

The sweep holds the initialization lock and retains current IDs and rows created since this boot. Sessions, customers, variable values and evaluation caches are untouched. See maintenance procedures.

Trigger an autonomous routine

Runs the routine asynchronously; the typed result is delivered later to callback_url — see Autonomous routines.

Request body — TriggerRequest

Body of POST /routines/{routine_id}/trigger.

Field
Type
Required
Default
Description

input

dict[string, JsonValue]

no

—

Validated against the routine's input_schema.

callback_url

string

yes

—

URL that receives the AutonomousCallbackPayload when the run settles.

session_id

string

no

null

Reuse an existing session. If omitted an ephemeral session + customer are created and deleted after the callback settles.

idempotency_key

string

no

null

Replay-safe key — duplicates return the prior run.

metadata

dict[string, JsonValue]

no

—

Opaque caller metadata echoed back in the callback payload.

input must satisfy the routine's input_schema; callback_url's hostname must match an entry of the routine's callback_url_allowlist when one is set.

Response 202 — run accepted:

Status
Meaning

202

Accepted; callback follows asynchronously.

400

Input failed input_schema validation (body carries error + path), or callback_url not allowed.

404

No autonomous routine with this id.

409

Duplicate idempotency_key — body echoes the prior run (run_id, status, session_id, created_at).

500

Session preparation or engine dispatch failed.

503

Server not ready.

Third-party webhook entry

{name} is either a manifest-level webhook name (fan-out to one or more routines) or a routine id whose YAML declares autonomous.webhook. The raw JSON body becomes the run input. Webhook runs are fire-and-forget — no callback. Replays of an identical body dedupe to the existing run.

Response 200 (manifest-level fan-out):

Per-routine webhooks return the same 202 envelope as the trigger endpoint (a replayed body returns 200 with the existing run).

Status
Meaning

200 / 202

Dispatched (or deduped replay).

400

Body is not a JSON object.

401

Missing/invalid signature.

404

Unknown webhook name.

502

Routine matching failed — the provider should retry.

503

Server not ready.

Inject a tool event

Appends a synthetic tool result to a session's history — for supplying large external context (statements, history dumps) as if a tool had fetched it. Semantics: Tools.

Request body — ToolEventRequest

Body of POST /sessions/{session_id}/tool_events.

Field
Type
Required
Default
Description

tool_id

string

yes

—

Opaque tool identifier surfaced to the LLM prompt. Canonical form is 'service_name:tool_name' (single colon), e.g. 'injected:conversation_history'.

arguments

dict[string, JsonValue]

no

—

Tool call arguments — becomes the tool call's arguments field.

result

JsonValue

yes

—

Tool result payload — becomes the tool result's data.

result_metadata

dict[string, JsonValue]

no

—

Becomes the tool result's metadata (inside the tool_calls entry).

event_metadata

dict[string, JsonValue]

no

—

Becomes the event's top-level metadata.

idempotency_key

string

no

null

Optional key for safe retries. If an injected tool event with this key already exists in the session, returns it without creating a duplicate. Stored in the event metadata.

trigger_processing

boolean

no

false

If true, runs a response turn immediately after injection. WARNING: this cancels any turn currently processing for this session.

Response 200:

Status
Meaning

200

Event created (or idempotent replay of an existing one).

404

Session not found.

503

Server not ready.

Chat attachments

Used by the /chat UI. config returns {"enabled": true, "max_bytes_by_extension": {".pdf": …}} when a policy or routine uses a FileStore reader (read_excel, read_pdf, read_docx, read_text, read_image) served by a FileStore MCP; otherwise every route but config answers 409. max_bytes_by_extension is the cap for each accepted extension. POST /attachments stores one PDF, XLSX, DOCX, CSV, TXT, Markdown, JSON, PNG, JPEG or WebP file in the project's Files and returns {file_id, version_id, name, content_type, size}. Attaching adds one custom event, {"attachments": [{file_id, version_id, name, content_type, size}]}, to the session; the agent reads the files with those ids through FileStore. Only files this agent uploaded can be attached. The versions route serves images only, for previews. Errors are {"detail": "..."}; the Files API's 400, 403, 409, 413 and 429 pass through. While attachments are on, custom events carrying attachments are refused on POST /sessions/{session_id}/events.

Routine graph

Returns the full routine state machine — {"journey": {...}, "nodes": [...], "edges": [...]} — for dashboards and debugging UIs. The journeys path segment is legacy wire naming for routines; ids are the engine-assigned routine ids surfaced in traces. 404 for unknown ids, 503 while booting.

Conversation & customer API

The session/customer surface is consumed through the SDK, which owns its ergonomics (idempotent open, typed events, reconnecting streams). The routes it drives:

Surface
Routes

Sessions

create / read; GET /sessions/{id}/events (long-poll, min_offset-resumable) — the event stream; POST /sessions/{id}/events — post customer/system messages

Customers

register / read / update; customer variables and metadata

Use Integrating the SDK for this surface; event wire shapes are in Events & callbacks. The server rate-shapes aggressive event polling via an x-polling-backoff response header (seconds to wait) that well-behaved clients honour.

Last updated

Was this helpful?