Tasks API
Tasks represent work to be done by AI agents.
Task Lifecycle
backlog → ready → in_progress → in_review → done
↓
waiting_on_subtasks
Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /projects/:projectId/tasks | Create a task |
POST | /projects/:projectId/tasks/bulk | Bulk create tasks |
GET | /projects/:projectId/tasks | List tasks |
GET | /projects/:projectId/stats | Get task statistics |
GET | /tasks/:id | Get a task |
PATCH | /tasks/:id | Update a task |
DELETE | /tasks/:id | Delete a task |
Task Actions
| Method | Endpoint | Description |
|---|---|---|
POST | /tasks/:id/start | Start task execution |
POST | /tasks/:id/retry | Retry failed task |
POST | /tasks/:id/cancel | Cancel running task |
POST | /tasks/:id/merge | Merge task's PR |
POST | /tasks/:id/chat | Chat with task's agent |
Task Data
| Method | Endpoint | Description |
|---|---|---|
GET | /tasks/:id/diff | Get git diff for task branch |
GET | /tasks/:id/handoffs | Get task handoffs |
GET | /tasks/:id/prs | Get multi-repo PRs |
GET | /tasks/:id/subtasks | Get subtasks |
POST | /tasks/:id/subtasks | Create a subtask |
Create a Task
curl -X POST https://api.team6.ai/projects/proj_xxx/tasks \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Add user authentication",
"description": "Implement JWT authentication with login endpoint",
"owner": "agent_backend",
"status": "backlog"
}'
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Task title |
description | string | No | Detailed description |
owner | string | No | Agent ID to assign |
status | string | No | Initial status (default: backlog) |
dependsOn | string[] | No | Task IDs this depends on |
repositoryId | string | No | Override default repository |
Response
{
"id": "task_abc123",
"title": "Add user authentication",
"description": "Implement JWT authentication with login endpoint",
"status": "backlog",
"owner": "agent_backend",
"projectId": "proj_xxx",
"branchName": null,
"prUrl": null,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z"
}
List Tasks
curl "https://api.team6.ai/projects/proj_xxx/tasks?status=in_progress&limit=10" \
-H "Authorization: Bearer $TOKEN"
Query Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status |
limit | number | Results per page |
offset | number | Pagination offset |
Start a Task
Triggers agent execution:
curl -X POST https://api.team6.ai/tasks/task_xxx/start \
-H "Authorization: Bearer $TOKEN"
The agent will:
- Clone the repository
- Create a feature branch
- Execute the task
- Create a pull request
Requirements
- Task must have an assigned agent (
owner) - Task status must be
backlogorready - Dependencies must be completed
Chat with Agent
Send a message to the agent working on a task:
curl -X POST https://api.team6.ai/tasks/task_xxx/chat \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": "Please add input validation"}'
Response
{
"response": "I've added input validation to the login endpoint...",
"taskId": "task_xxx"
}
Get Task Diff
View changes made by the agent:
curl https://api.team6.ai/tasks/task_xxx/diff \
-H "Authorization: Bearer $TOKEN"
Response
{
"taskId": "task_xxx",
"branchName": "task/task_xxx",
"baseBranch": "main",
"files": [
{
"path": "src/auth/login.ts",
"status": "added",
"additions": 45,
"deletions": 0,
"hunks": [...]
}
]
}
Subtasks
Break large tasks into smaller pieces:
Create Subtask
curl -X POST https://api.team6.ai/tasks/task_xxx/subtasks \
-H "Authorization: Bearer $TOKEN" \
-d '{
"title": "Add password hashing",
"description": "Implement bcrypt password hashing"
}'
Parent task moves to waiting_on_subtasks until all subtasks complete.
List Subtasks
curl https://api.team6.ai/tasks/task_xxx/subtasks \
-H "Authorization: Bearer $TOKEN"
Handoffs
Context passed between agent sessions:
curl https://api.team6.ai/tasks/task_xxx/handoffs \
-H "Authorization: Bearer $TOKEN"
Response
{
"handoffs": [
{
"id": "handoff_xxx",
"taskId": "task_xxx",
"summary": "Completed authentication backend, needs frontend integration",
"nextSteps": ["Add login form", "Connect to API"],
"createdAt": "2024-01-15T12:00:00Z"
}
]
}
Multi-Repo PRs
For tasks that span multiple repositories:
curl https://api.team6.ai/tasks/task_xxx/prs \
-H "Authorization: Bearer $TOKEN"
Response
[
{
"repositoryId": "repo_backend",
"repositoryName": "backend-api",
"prUrl": "https://github.com/org/backend-api/pull/42",
"prNumber": 42,
"status": "open"
},
{
"repositoryId": "repo_frontend",
"repositoryName": "frontend-app",
"prUrl": "https://github.com/org/frontend-app/pull/18",
"prNumber": 18,
"status": "open"
}
]
Task Statistics
Get project-level task stats:
curl https://api.team6.ai/projects/proj_xxx/stats \
-H "Authorization: Bearer $TOKEN"
Response
{
"total": 45,
"byStatus": {
"backlog": 12,
"ready": 5,
"in_progress": 3,
"in_review": 8,
"done": 17
}
}