Common Patterns
Create an orchestration, add entity agents with clear role descriptions, then use the streaming endpoint. The coordinator automatically handles delegation. Entity role descriptions should be specific and non-overlapping so the coordinator can make clear routing decisions.CRUD
POST /api/orchestrations
Create an orchestration.GET /api/orchestrations
List all orchestrations.GET /api/orchestrations/
Get orchestration with its entities.Orchestration ID
PUT /api/orchestrations/
Update orchestration config.Orchestration ID
DELETE /api/orchestrations/
Delete an orchestration.Orchestration ID
Entities
POST /api/orchestrations//entities
Add an agent as an entity.Orchestration ID
Use
"agent". The route accepts any string ≤50 chars, but the orchestrator’s execution path only invokes entities where entity_type === "agent" — other values are stored but silently skipped at run time.UUID of the agent to add.
Free-text role hint shown to the coordinator when delegating. Replaces the prior
role field used in older docs examples.Per-entity overrides; defaults to
{}.Sort order in list responses; defaults to
0.The route returns 400 if either
entity_type or entity_ref_id is missing. List/PUT responses key off entity_ref_id and role_description, so any client trying to round-trip will see the same field names.GET /api/orchestrations//entities
List entities in the orchestration.Orchestration ID
PUT /api/orchestrations//entities/
Update an entity. Onlyrole_description, config, and position are writable — any other top-level keys are silently ignored. entity_type and entity_ref_id are not updatable; create a new entity instead.
Orchestration ID
Entity ID
Free-text role hint shown to the coordinator when delegating.
Per-entity overrides.
Sort order in list responses.
DELETE /api/orchestrations//entities/
Remove an entity.Orchestration ID
Entity ID
Execution
POST /api/orchestrations//run/stream
Run orchestration with streaming SSE. Includes delegation events.Orchestration ID
GET /api/orchestrations/runs/
Get orchestration run result.Run ID
Hooks
Orchestration hooks fire at lifecycle events (e.g.before_run, after_run) and can call out to webhooks or other handler types. Hooks fire in position order; setting enabled: false keeps the row but skips execution.
POST /api/orchestrations//hooks
Add a hook.Orchestration ID
Lifecycle event name (e.g.
before_run, after_run).Hook handler type (e.g.
webhook).Handler-specific configuration (for
webhook type, includes url).Optional condition narrowing when the hook fires.
Defaults to
true.Execution order within the event. Defaults to
0.GET /api/orchestrations//hooks
List hooks for the orchestration, ordered byposition.
Orchestration ID
DELETE /api/orchestrations//hooks/
Remove a hook.Orchestration ID
Hook ID
Sessions
Session-level reads on orchestrations. The streaming/run/stream endpoint returns a session_id you can use here to fetch history.
GET /api/orchestrations//sessions
List the most recent 100 sessions for an orchestration. Each entry includessession_id, run_count, first_message, last_activity_at, and created_at.
Orchestration ID
GET /api/orchestrations//sessions//messages
Assembled messages for a session. Each assistant message carries per-run reasoning replay metadata (reasoning_requested, reasoning_duration_ms, reasoning, events) so a chat UI can re-render the original “Thought for X.Xs” pill on refresh. Tool calls are attached per-message via tool_calls. The legacy top-level events field is preserved for older clients.
Orchestration ID
Session ID
Error Responses
Orchestration routes return{"error": "<message>"} (no structured error code field).
| Status | Description |
|---|---|
| 400 | The orchestration has no entity agents — add at least one before running |
| 400 | Hook POST is missing one of event, type, or config |
| 404 | No orchestration exists with the given ID |
| 404 | No hook exists with the given ID for this orchestration |
| 404 | No orchestration session with the given ID |