Org in a Box
API Reference

Orchestrator API

Submit multi-task plans and check their status.

POST /v1/orchestrate

Submit a complex task for decomposition and parallel execution.

Request:

{
  "parentSessionId": "<opencode session id>",
  "taskDescription": "Research 3 competitors, write a comparison table, and draft an executive summary",
  "maxSubtasks": 5
}

parentSessionId is required. userId falls back to the authenticated user's id when present. maxSubtasks defaults to 5.

Response:

{
  "jobId": "uuid-...",
  "status": "queued"
}

The plan itself is created asynchronously by the orchestrator-plan job handler. Poll GET /v1/orchestrate/plans (or subscribe to SSE on the parent session) to pick up the planId once the handler has run.


GET /v1/orchestrate/:planId

Get the current status of an orchestration plan.

Response:

{
  "plan": {
    "id": "uuid",
    "status": "executing",
    "taskDescription": "Research 3 competitors...",
    "createdAt": "2026-04-18T..."
  },
  "subtasks": [
    {
      "index": 0,
      "description": "Research competitor A",
      "status": "completed",
      "result": "Competitor A is...",
      "startedAt": "...",
      "completedAt": "..."
    },
    {
      "index": 1,
      "description": "Research competitor B",
      "status": "running"
    },
    {
      "index": 2,
      "description": "Write comparison table",
      "status": "pending",
      "dependencies": [0, 1]
    }
  ]
}

Plan statuses: planning → executing → synthesizing → completed | failed

Subtask statuses: pending → running → completed | failed


GET /v1/orchestrate/plans

List recent orchestration plans for the authenticated user.

Query parameters:

  • status — filter by plan status
  • limit — max results (default 20)

On this page