Tasks API
List tasks
Section titled “List tasks”GET /api/tasksReturns all tasks in the current workspace.
Query parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status (backlog, queued, processing, done, failed, blocked) |
project_id | string | Filter by project |
type | string | Filter by type (code, writing, thinking) |
all | boolean | Set to true to include closed/completed tasks |
Response 200 OK
[ { "id": "task_abc123", "title": "Fix login validation", "status": "done", "type": "code", "cost_cents": 12, "created_at": "2025-01-15T10:00:00Z" }]Create task
Section titled “Create task”POST /api/tasksRequest body
{ "title": "Add user profile page", "body": "Create a profile page at /profile with name, email, and avatar fields", "type": "code", "project_id": "proj_abc123", "model_id": "claude-sonnet-4-5"}Response 201 Created
Returns the created task object.
Get task
Section titled “Get task”GET /api/tasks/{id}Returns the full task object including metadata, cost, and timing.
Update task
Section titled “Update task”PUT /api/tasks/{id}Request body
{ "title": "Updated title", "status": "queued", "body": "Updated requirements"}Response 200 OK
Delete task
Section titled “Delete task”DELETE /api/tasks/{id}Response 200 OK
Interrupt task
Section titled “Interrupt task”POST /api/tasks/{id}/interruptStops a running task immediately. The task moves to the failed state.
Response 200 OK
Capture screenshot
Section titled “Capture screenshot”POST /api/tasks/{id}/screenshotTakes a screenshot of the task’s browser sandbox.
Response 200 OK
Get task logs
Section titled “Get task logs”GET /api/tasks/{id}/logsReturns execution logs for the task.
Response 200 OK
[ { "id": "log_1", "line_type": "system", "content": "Cloning repository...", "created_at": "2025-01-15T10:01:00Z" }, { "id": "log_2", "line_type": "text", "content": "Creating file src/pages/profile.tsx", "created_at": "2025-01-15T10:01:05Z" }]Task files
Section titled “Task files”List files
Section titled “List files”GET /api/tasks/{id}/filesReturns files generated by the task.
Read file
Section titled “Read file”GET /api/tasks/{id}/file?path=src/index.tsxReturns the content of a specific file from the task’s storage.
Annotations
Section titled “Annotations”List annotations
Section titled “List annotations”GET /api/tasks/{id}/annotationsCreate annotation
Section titled “Create annotation”POST /api/tasks/{id}/annotationsRequest body
{ "file_path": "src/pages/profile.tsx", "annotation_type": "inline", "line_number": 42, "body": "Consider using a form library for validation"}Update annotation
Section titled “Update annotation”PUT /api/tasks/{id}/annotations?annotation_id=ann_123Delete annotation
Section titled “Delete annotation”DELETE /api/tasks/{id}/annotations?annotation_id=ann_123Note: Annotation update and delete use the annotation_id query parameter, not a path parameter.
Workflow actions
Section titled “Workflow actions”POST /api/tasks/{id}/workflowControl task workflow execution.
Request body
{ "action": "approve"}Valid actions: pause, resume, approve, reject, terminate, status
Get workflow status
Section titled “Get workflow status”GET /api/tasks/{id}/workflowReturns the current workflow status for the task.