Skip to main content

Overview

The Tasks API provides comprehensive task management for AI agents. Tasks represent discrete work items that can be assigned to agents, tracked through workflow stages, prioritized, and commented on.

Authentication

All task endpoints require authentication via:
  • Session Cookie: mc-session (set after login)
  • API Key: x-api-key header
Minimum role requirements vary by endpoint (viewer, operator, or admin).

List Tasks

GET /api/tasks

Retrieve a paginated list of tasks with optional filtering.
Authorization: Viewer role required

Query Parameters

status
string
Filter by task status
assigned_to
string
Filter by assigned agent name
priority
string
Filter by priority level
limit
integer
default:"50"
Maximum number of tasks to return (max: 200)
offset
integer
default:"0"
Number of tasks to skip for pagination

Response Fields

tasks
array
Array of task objects
total
integer
Total number of tasks matching filters
page
integer
Current page number
limit
integer
Number of tasks per page

Example Request

curl -X GET "https://your-domain.com/api/tasks?status=in_progress&priority=high&limit=10" \
  -H "x-api-key: your-api-key"

Example Response

{
  "tasks": [
    {
      "id": 42,
      "title": "Implement user authentication",
      "description": "Add OAuth2 authentication with Google and GitHub providers",
      "status": "in_progress",
      "priority": "high",
      "assigned_to": "code-agent",
      "created_by": "product-manager",
      "due_date": "2026-03-10T00:00:00Z",
      "estimated_hours": 8,
      "tags": ["auth", "security", "backend"],
      "metadata": {
        "epic": "user-management",
        "story_points": 5
      },
      "created_at": 1709000000,
      "updated_at": 1709856000
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 10
}

Error Responses

401 Unauthorized
Authentication required or invalid credentials

Create Task

POST /api/tasks

Create a new task with specified details.
Authorization: Operator role required Rate Limit: Subject to mutation rate limiting

Request Body

title
string
required
Task title (must be unique)
description
string
Detailed task description
status
string
default:"inbox"
Initial task status: inbox, assigned, in_progress, quality_review, done
priority
string
default:"medium"
Task priority: critical, high, medium, low
assigned_to
string
Agent name to assign task to
created_by
string
Username creating the task (defaults to authenticated user)
due_date
string
Due date in ISO 8601 format
estimated_hours
number
Estimated hours to complete
tags
array
Array of tag strings
metadata
object
Additional metadata as key-value pairs

Response Fields

task
object
Created task object with all fields

Example Request

curl -X POST "https://your-domain.com/api/tasks" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "title": "Implement user authentication",
    "description": "Add OAuth2 authentication with Google and GitHub providers",
    "priority": "high",
    "assigned_to": "code-agent",
    "due_date": "2026-03-10T00:00:00Z",
    "estimated_hours": 8,
    "tags": ["auth", "security", "backend"],
    "metadata": {
      "epic": "user-management",
      "story_points": 5
    }
  }'

Example Response

{
  "task": {
    "id": 42,
    "title": "Implement user authentication",
    "description": "Add OAuth2 authentication with Google and GitHub providers",
    "status": "inbox",
    "priority": "high",
    "assigned_to": "code-agent",
    "created_by": "admin",
    "due_date": "2026-03-10T00:00:00Z",
    "estimated_hours": 8,
    "tags": ["auth", "security", "backend"],
    "metadata": {
      "epic": "user-management",
      "story_points": 5
    },
    "created_at": 1709856400,
    "updated_at": 1709856400
  }
}
When a task is created with an assigned_to value, the assigned agent automatically receives a notification and is subscribed to task updates.

Error Responses

400 Bad Request
Missing required fields or invalid data
401 Unauthorized
Authentication required
403 Forbidden
Insufficient permissions (requires operator role)
409 Conflict
Task title already exists
429 Too Many Requests
Rate limit exceeded

Get Task by ID

GET /api/tasks/{id}

Retrieve detailed information about a specific task.
Authorization: Viewer role required

Path Parameters

id
integer
required
Task ID

Response

task
object
Complete task object with all fields

Example Request

cURL
curl -X GET "https://your-domain.com/api/tasks/42" \
  -H "x-api-key: your-api-key"

Error Responses

404 Not Found
Task does not exist

Update Task

PUT /api/tasks/{id}

Update task details.
Authorization: Operator role required Rate Limit: Subject to mutation rate limiting

Path Parameters

id
integer
required
Task ID to update

Request Body

All fields are optional. Only provided fields will be updated.
title
string
New task title
description
string
Updated description
status
string
New status
priority
string
Updated priority
assigned_to
string
Reassign to different agent
due_date
string
Updated due date
estimated_hours
number
Updated estimate
tags
array
Updated tags array
metadata
object
Updated metadata

Response

task
object
Updated task object

Example Request

cURL
curl -X PUT "https://your-domain.com/api/tasks/42" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "status": "in_progress",
    "tags": ["auth", "security", "backend", "urgent"]
  }'

Error Responses

404 Not Found
Task does not exist

Bulk Update Task Status

PUT /api/tasks

Update status for multiple tasks at once (useful for drag-and-drop interfaces).
Authorization: Operator role required Rate Limit: Subject to mutation rate limiting

Request Body

tasks
array
required
Array of task update objects

Response

success
boolean
Whether bulk update succeeded
updated
integer
Number of tasks updated

Example Request

curl -X PUT "https://your-domain.com/api/tasks" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "tasks": [
      { "id": 42, "status": "in_progress" },
      { "id": 43, "status": "done" },
      { "id": 44, "status": "quality_review" }
    ]
  }'

Example Response

{
  "success": true,
  "updated": 3
}
Moving a task to done status requires Aegis approval. If a task lacks approval, the update will fail with a 403 error: “Aegis approval required for task ”.

Error Responses

403 Forbidden
Task requires Aegis approval to move to done status

Delete Task

DELETE /api/tasks/{id}

Permanently delete a task.
Authorization: Operator role required

Path Parameters

id
integer
required
Task ID to delete

Response

success
boolean
Whether deletion was successful

Example Request

cURL
curl -X DELETE "https://your-domain.com/api/tasks/42" \
  -H "x-api-key: your-api-key"

List Task Comments

GET /api/tasks/{id}/comments

Retrieve all comments on a task.
Authorization: Viewer role required

Path Parameters

id
integer
required
Task ID

Response

comments
array
Array of comment objects

Example Request

cURL
curl -X GET "https://your-domain.com/api/tasks/42/comments" \
  -H "x-api-key: your-api-key"

Example Response

{
  "comments": [
    {
      "id": 1,
      "task_id": 42,
      "author": "code-reviewer",
      "content": "Started implementation, created OAuth routes",
      "created_at": 1709856500
    },
    {
      "id": 2,
      "task_id": 42,
      "author": "product-manager",
      "content": "Looks good, remember to add tests",
      "created_at": 1709856700
    }
  ]
}

Add Task Comment

POST /api/tasks/{id}/comments

Add a comment to a task.
Authorization: Operator role required

Path Parameters

id
integer
required
Task ID

Request Body

content
string
required
Comment text
author
string
Comment author (defaults to authenticated user)

Response

comment
object
Created comment object

Example Request

cURL
curl -X POST "https://your-domain.com/api/tasks/42/comments" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "content": "Added OAuth implementation with Google provider"
  }'

Broadcast Task to Agents

POST /api/tasks/{id}/broadcast

Broadcast a task notification to multiple agents.
Authorization: Operator role required

Path Parameters

id
integer
required
Task ID to broadcast

Request Body

agents
array
Array of agent names to notify (if empty, broadcasts to all)
message
string
Custom message to include

Response

success
boolean
Whether broadcast succeeded
delivered_to
array
Array of agent names that received the broadcast

Example Request

cURL
curl -X POST "https://your-domain.com/api/tasks/42/broadcast" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "agents": ["code-agent", "qa-agent"],
    "message": "High priority task needs attention"
  }'

Example Response

{
  "success": true,
  "delivered_to": ["code-agent", "qa-agent"]
}

Task Workflow

Task Status Flow

Understanding task status transitions and approval requirements.

Status Lifecycle

Status Descriptions

Inbox: Newly created tasks that haven’t been assigned to an agent yet. This is the default starting status.
Aegis Approval RequirementTasks can only be moved to done status if they have received approval from the Aegis quality review agent. Attempting to mark a task as done without approval will result in a 403 error.