Skip to main content

Tasks API

Tasks represent work to be done by AI agents.

Task Lifecycle

backlog → ready → in_progress → in_review → done

waiting_on_subtasks

Endpoints

MethodEndpointDescription
POST/projects/:projectId/tasksCreate a task
POST/projects/:projectId/tasks/bulkBulk create tasks
GET/projects/:projectId/tasksList tasks
GET/projects/:projectId/statsGet task statistics
GET/tasks/:idGet a task
PATCH/tasks/:idUpdate a task
DELETE/tasks/:idDelete a task

Task Actions

MethodEndpointDescription
POST/tasks/:id/startStart task execution
POST/tasks/:id/retryRetry failed task
POST/tasks/:id/cancelCancel running task
POST/tasks/:id/mergeMerge task's PR
POST/tasks/:id/chatChat with task's agent

Task Data

MethodEndpointDescription
GET/tasks/:id/diffGet git diff for task branch
GET/tasks/:id/handoffsGet task handoffs
GET/tasks/:id/prsGet multi-repo PRs
GET/tasks/:id/subtasksGet subtasks
POST/tasks/:id/subtasksCreate 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

FieldTypeRequiredDescription
titlestringYesTask title
descriptionstringNoDetailed description
ownerstringNoAgent ID to assign
statusstringNoInitial status (default: backlog)
dependsOnstring[]NoTask IDs this depends on
repositoryIdstringNoOverride 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

ParameterTypeDescription
statusstringFilter by status
limitnumberResults per page
offsetnumberPagination 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:

  1. Clone the repository
  2. Create a feature branch
  3. Execute the task
  4. Create a pull request

Requirements

  • Task must have an assigned agent (owner)
  • Task status must be backlog or ready
  • 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
}
}