The lifecycle, status values, and event stream below are identical across agent runtimes — a Codex task and a Claude task move through the same states and emit the same events. Whichever runtime the
model (or agent override) selects is transparent to every endpoint on this page.Lifecycle Overview
Status Values
| Status | Description | Terminal? |
|---|---|---|
queued | Task is waiting to be picked up by an agent | No |
running | Agent is actively executing the task | No |
completed | Task finished successfully | ✅ Yes |
failed | Task encountered an unrecoverable error | ✅ Yes |
cancelled | Task was cancelled by the user | ✅ Yes |
interrupted | Task was interrupted (e.g. server restart) | ✅ Yes |
Phase 1 — Create
Start a task withPOST /api/v1/tasks. You receive a runId immediately — the agent begins executing asynchronously.
runId — you’ll use it for every subsequent operation.
Phase 2 — Monitor
You have two options for tracking progress:Option A — Poll Status (lightweight)
Best for simple integrations. CallGET /api/v1/tasks/:id/status every few seconds:
progress field (0–100) is a linear estimate based on elapsed time.
Option B — Stream Logs (real-time)
Best for live UIs or CLI output. Connect to the SSE stream and receive events as they happen:Phase 3 — Retrieve Results
Once completed, fetch the full task details including the conversation history and GitHub context:| Field | Description |
|---|---|
status | Final status of the run |
github.createdBranch | Branch the agent pushed changes to |
messages | Full conversation history |
completedAt | ISO 8601 timestamp of completion |
Phase 4 — Continue (Optional)
Send a follow-up prompt to the same task. The agent receives the full conversation history as context and, if a GitHub repo was involved, continues from the branch it created:runId for the follow-up run. Use it to track the continuation independently.
Cancel a Running Task
Send aPATCH request with action: "cancel" at any point while the task is queued or running:
success: false.
Multi-Agent Tasks
When you passselectedAgents with 2–5 entries, each agent gets its own runId. Track each run independently using the same endpoints described above.
Recommended Patterns
Simple — Poll with Backoff
Advanced — Stream + Continue
Related Endpoints
Create Task
POST /api/v1/tasksGet Task Status
GET /api/v1/tasks/:id/statusStream Task Logs
GET /api/v1/tasks/:id/logs/streamContinue Task
POST /api/v1/tasks/:id/continueGet Task
GET /api/v1/tasks/:idCancel Task
PATCH /api/v1/tasks/:id