Skip to content

Tasks API

GET /api/tasks

Returns all tasks in the current workspace.

Query parameters

ParameterTypeDescription
statusstringFilter by status (backlog, queued, processing, done, failed, blocked)
project_idstringFilter by project
typestringFilter by type (code, writing, thinking)
allbooleanSet 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"
}
]
POST /api/tasks

Request 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 /api/tasks/{id}

Returns the full task object including metadata, cost, and timing.

PUT /api/tasks/{id}

Request body

{
"title": "Updated title",
"status": "queued",
"body": "Updated requirements"
}

Response 200 OK

DELETE /api/tasks/{id}

Response 200 OK

POST /api/tasks/{id}/interrupt

Stops a running task immediately. The task moves to the failed state.

Response 200 OK

POST /api/tasks/{id}/screenshot

Takes a screenshot of the task’s browser sandbox.

Response 200 OK

GET /api/tasks/{id}/logs

Returns 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"
}
]
GET /api/tasks/{id}/files

Returns files generated by the task.

GET /api/tasks/{id}/file?path=src/index.tsx

Returns the content of a specific file from the task’s storage.

GET /api/tasks/{id}/annotations
POST /api/tasks/{id}/annotations

Request body

{
"file_path": "src/pages/profile.tsx",
"annotation_type": "inline",
"line_number": 42,
"body": "Consider using a form library for validation"
}
PUT /api/tasks/{id}/annotations?annotation_id=ann_123
DELETE /api/tasks/{id}/annotations?annotation_id=ann_123

Note: Annotation update and delete use the annotation_id query parameter, not a path parameter.

POST /api/tasks/{id}/workflow

Control task workflow execution.

Request body

{
"action": "approve"
}

Valid actions: pause, resume, approve, reject, terminate, status

GET /api/tasks/{id}/workflow

Returns the current workflow status for the task.