# Aisenhour API and Tool Reference

> Public reference for personal AI assistant tools, web endpoints, quadrants, and schema limits.

*Not yet verified*

## Overview

Aisenhour provides two interfaces for personal AI assistants:
1. **Personal Assistant Tools:** Connect assistant clients like Claude Desktop, Claude Code, Cursor, Google Antigravity, and Meta Muse over Streamable HTTP at `https://aisenhour.com/api/mcp` using browser sign-in (OAuth 2.1) or API keys.
2. **Direct Web Requests:** Standard JSON endpoints authenticated with `Authorization: Bearer <API_KEY>` headers for scripts, automations, and custom agents at `https://aisenhour.com/api/v1` (OpenAPI 3.1 spec: [https://aisenhour.com/api/openapi.json](https://aisenhour.com/api/openapi.json)).

## Task Ownership and Board Permissions

### Capturing Tasks for Yourself vs Assistant (`assignTo`)

When creating a task via `aisenhour_create_task` or `POST /v1/tasks`, the `assignTo` field is required:
- **`assignTo: "me"`**: Captures a human-owned task directly for the user (`agentPickup: false`). It enforces the user's active-task plan limit (e.g. 25 on Free, unlimited on Pro) and returns `{ id, title }`. The assistant cannot read this task back unless whole-board reading is enabled.
- **`assignTo: "self"`**: Retains the task for the calling assistant (`agentPickup: true`, bound to the assistant's key).

### Whole-Board Reading (`canReadBoard`)

In Aisenhour **Settings > My agents**, users can toggle the **"Can read my whole board"** permission per assistant:
- When enabled, read tools (`aisenhour_list_tasks`, `aisenhour_get_task`, `aisenhour_get_matrix_summary`, and `GET /v1/tasks`, `GET /v1/tasks/:id`) return active tasks across all four quadrants (projected cleanly without private notes or comments) so assistants can answer daily planning and prioritization questions.
- **Strict Read-Only Boundary:** Write tools (`aisenhour_request_input`, `aisenhour_move_quadrant`, `aisenhour_complete_task`, `aisenhour_archive_task`, `aisenhour_add_subtask`, `aisenhour_complete_subtask`, `aisenhour_report_progress`, `aisenhour_add_comment`, `aisenhour_claim_task`, `PATCH /v1/tasks/:id`, `DELETE /v1/tasks/:id`) remain strictly restricted to tasks assigned to that specific assistant, regardless of the board-reading setting.

## Tools for Assistants (14 Tools)

### `aisenhour_get_task`

- **Access:** Read-only
- **Arguments:** `taskId`
- **Description:** Retrieves one task by ID, limited to the calling assistant’s assigned tasks with pickup enabled (or an active board task when whole-board reading is enabled).
- **Schema Fields:**
  - `taskId` (required): ID of the single task to retrieve

### `aisenhour_get_matrix_summary`

- **Access:** Read-only
- **Arguments:** `None`
- **Description:** Provides executive summary counts of active tasks across all four quadrants (doFirst, decide, delegate, delete), upcoming deadlines, and claimable items.

### `aisenhour_list_tasks`

- **Access:** Read-only
- **Arguments:** `assignedToMe?, claimable?, quadrant?, category?, lifecycle?, includeScheduled?, includeCompleted?, status?, query?, limit?, cursor?`
- **Description:** Lists tasks from the Eisenhower Matrix with optional filters for assignment, claimable delegate tasks, quadrant, category, and status. Results are paged with limit and cursor.
- **Schema Fields:**
  - `assignedToMe` (optional): If true, filters to tasks explicitly assigned to the calling assistant
  - `claimable` (optional): If true, filters to unassigned tasks in the Delegate quadrant enabled for agent pickup
  - `quadrant` (optional): Filter by Eisenhower quadrant: doFirst, decide, delegate, delete
  - `category` (optional): Filter by category (Work, Personal, Health, Finance, etc.)
  - `lifecycle` (optional): Task lifecycle state: active or archived
  - `includeScheduled` (optional): If true, includes tasks scheduled for a future start date. Defaults to false.
  - `includeCompleted` (optional): If true, includes completed-but-not-archived tasks. Defaults to false.
  - `status` (optional): Filter by completion status: "open"/"active" (default), "completed", or "all"
  - `query` (optional): Case-insensitive text search filter across title and description
  - `limit` (optional): Maximum number of tasks to return (1..100, default 25)
  - `cursor` (optional): Pagination cursor token returned from a previous list call

### `aisenhour_create_task`

- **Access:** Write
- **Arguments:** `assignTo, title, quadrant?, category?, assignee?, description?, subtasks?, dueDate?, scheduledFor?, recurring?, lifecycle?, doneWhen?, constraints?, order?`
- **Description:** Adds a new task to the user's Eisenhower Matrix canvas. Specify assignTo ("me" to capture for the person, or "self" for the assistant).
- **Schema Fields:**
  - `assignTo` (required): Assign the task to the person ("me") or keep for this assistant ("self")
  - `title` (required): Task title (concise and actionable, max 120 chars)
  - `quadrant` (optional): doFirst (critical/urgent), decide (strategic), delegate (human or agent delegation), delete (triage)
  - `category` (optional): Category name
  - `assignee` (optional): Text label for the assigned person or assistant (informational only; separate from task sharing invites)
  - `description` (optional): Additional context or requirements (max 2000 chars)
  - `subtasks` (optional): List of checklist subtasks (max 50 subtasks, each max 500 chars)
  - `dueDate` (optional): ISO date string or deadline
  - `scheduledFor` (optional): Start date (YYYY-MM-DD); future tasks still count toward the active-task limit
  - `recurring` (optional): Daily, weekly or monthly habit; next due date is initialized in your timezone
  - `lifecycle` (optional): Task lifecycle state (active, archived)
  - `doneWhen` (optional): What a finished result looks like (max 500 chars)
  - `constraints` (optional): What not to do (max 500 chars)
  - `order` (optional): Optional fractional order position

### `aisenhour_add_subtask`

- **Access:** Write
- **Arguments:** `taskId, text, assignedToAgent?`
- **Description:** Adds a new actionable checklist step to an existing task in the Eisenhower Matrix.
- **Schema Fields:**
  - `taskId` (required): ID of the task
  - `text` (required): Checklist step text (max 500 chars)
  - `assignedToAgent` (optional): Whether this step is delegated to the assistant

### `aisenhour_complete_subtask`

- **Access:** Write
- **Arguments:** `taskId, subtaskId, note?`
- **Description:** Marks a specific subtask as completed by the assistant on behalf of the user.
- **Schema Fields:**
  - `taskId` (required): ID of the parent task
  - `subtaskId` (required): ID of the subtask to check off
  - `note` (optional): Brief note on what the assistant accomplished (max 1000 chars)

### `aisenhour_request_input`

- **Access:** Write
- **Arguments:** `taskId, question, options?`
- **Description:** Asks the user a clarifying question about an assigned task, optionally offering quick-choice answer options.
- **Schema Fields:**
  - `taskId` (required): ID of the task
  - `question` (required): Clarifying question for the task owner (1..1000 chars)
  - `options` (optional): Optional quick-choice answer options (up to 5 options, each max 120 chars)

### `aisenhour_report_progress`

- **Access:** Write
- **Arguments:** `taskId, status, thought?, summary?, deliverable?, completedSubtaskIds?`
- **Description:** Logs an agent execution report and deliverable directly into the user's real-time Aisenhour drawer. Status must be "in_progress" or "delivered".
- **Schema Fields:**
  - `taskId` (required): ID of the task
  - `status` (required): Report status: "in_progress" for interim updates or "delivered" for a completed result ready for user review
  - `thought` (optional): Summary of what the assistant investigated or resolved (max 2000 chars)
  - `summary` (optional): Formatted summary or deliverable note (max 4000 chars)
  - `deliverable` (optional): Formatted final text, summary, email draft, or links (max 10000 chars)
  - `completedSubtaskIds` (optional): IDs of any subtasks to mark completed

### `aisenhour_move_quadrant`

- **Access:** Write
- **Arguments:** `taskId, newQuadrant`
- **Description:** Moves a task to another quadrant (e.g. from Delegate to Do First or Delete).
- **Schema Fields:**
  - `taskId` (required): Task ID
  - `newQuadrant` (required): Target quadrant (doFirst, decide, delegate, delete)

### `aisenhour_complete_task`

- **Access:** Write
- **Arguments:** `taskId`
- **Description:** Marks a non-recurring or recurring task completed. For non-recurring tasks, sets completedAt without archiving.
- **Schema Fields:**
  - `taskId` (required): ID of the task to complete

### `aisenhour_archive_task`

- **Access:** Write
- **Arguments:** `taskId`
- **Description:** Archives a task by setting lifecycle to "archived". The task is removed from active matrix views into the Archive.
- **Schema Fields:**
  - `taskId` (required): ID of the task to archive

### `aisenhour_list_comments`

- **Access:** Read-only
- **Arguments:** `taskId, target?`
- **Description:** Lists comments on a task enabled for AI agent pickup. Can specify target "private" or "shared".
- **Schema Fields:**
  - `taskId` (required): ID of the task
  - `target` (optional): Target comments thread: "private" or "shared"

### `aisenhour_add_comment`

- **Access:** Write
- **Arguments:** `taskId, text, target?`
- **Description:** Adds a comment on a task enabled for AI agent pickup. Defaults to private comments. Posting to a share thread requires a write key.
- **Schema Fields:**
  - `taskId` (required): ID of the task
  - `text` (required): Comment text (max 2000 chars)
  - `target` (optional): Target comments thread: "private" or "shared"

### `aisenhour_claim_task`

- **Access:** Write
- **Arguments:** `taskId`
- **Description:** Atomically claims a claimable unassigned task (claimable: true) from the Delegate queue for the calling agent (requires canClaim enabled on the agent key). Must be called before reading subtasks or mutating a claimable task.
- **Schema Fields:**
  - `taskId` (required): ID of the task to claim for this agent

## Browser sign-in and authorization

Aisenhour supports OAuth 2.1 with PKCE (`S256`) for automatic URL sign-in from compatible assistant clients, alongside static `Bearer <API_KEY>` tokens.

### `GET /.well-known/oauth-protected-resource`

- **Summary:** Protected resource metadata (RFC 9728)
- **Description:** Returns OAuth 2.1 protected resource metadata including the canonical resource URL, authorization servers, supported bearer methods, and scopes ("read", "write").

**Response Example:**
```json
{
  "resource": "https://aisenhour.com/api/mcp",
  "authorization_servers": [
    "https://aisenhour.com"
  ],
  "bearer_methods_supported": [
    "header"
  ],
  "scopes_supported": [
    "read",
    "write"
  ]
}
```

### `GET /.well-known/oauth-authorization-server`

- **Summary:** Authorization server metadata (RFC 8414)
- **Description:** Returns authorization server metadata for dynamic client discovery, including authorization endpoint, token endpoint, registration endpoint, revocation endpoint, code challenge methods ("S256"), and response types ("code").

**Response Example:**
```json
{
  "issuer": "https://aisenhour.com",
  "authorization_endpoint": "https://aisenhour.com/oauth/consent",
  "token_endpoint": "https://aisenhour.com/api/oauth/token",
  "registration_endpoint": "https://aisenhour.com/api/oauth/register",
  "revocation_endpoint": "https://aisenhour.com/api/oauth/revoke",
  "response_types_supported": [
    "code"
  ],
  "grant_types_supported": [
    "authorization_code",
    "refresh_token"
  ],
  "code_challenge_methods_supported": [
    "S256"
  ],
  "token_endpoint_auth_methods_supported": [
    "none",
    "client_secret_post"
  ]
}
```

### `POST /api/oauth/register`

- **Summary:** Dynamic client registration (RFC 7591)
- **Description:** Dynamically registers an assistant client (e.g. Claude Code, Cursor) with client_name and allowed redirect_uris. Returns client_id.

**Request Body:**
```json
{
  "client_name": "Cursor MCP",
  "redirect_uris": [
    "cursor://anysphere.cursor-mcp/oauth/callback"
  ]
}
```

**Response Example:**
```json
{
  "client_id": "cli_0123456789abcdef",
  "client_name": "Cursor MCP",
  "redirect_uris": [
    "cursor://anysphere.cursor-mcp/oauth/callback"
  ]
}
```

### `GET /api/oauth/authorize`

- **Summary:** User authorization consent
- **Description:** Browser consent screen (/oauth/consent or /api/oauth/authorize). The assistant opens this page with response_type=code, client_id, redirect_uri, code_challenge, code_challenge_method=S256, and resource=https://aisenhour.com/api/mcp. After approval, redirects to redirect_uri with a single-use authorization code.

**Response Example:**
```text
HTTP 302 Redirect to redirect_uri?code=ah_code_xxx&state=xyz
```

### `POST /api/oauth/token`

- **Summary:** Token exchange and refresh
- **Description:** Exchanges an authorization code with PKCE code_verifier for an access token (ah_mcp_at_...) and rotating refresh token (ah_mcp_rt_...), or exchanges a refresh token for a new access token and rotated refresh token.

**Request Body:**
```json
{
  "grant_type": "authorization_code",
  "code": "ah_code_sample",
  "code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",
  "client_id": "cli_0123456789abcdef",
  "redirect_uri": "cursor://anysphere.cursor-mcp/oauth/callback",
  "resource": "https://aisenhour.com/api/mcp"
}
```

**Response Example:**
```json
{
  "access_token": "ah_mcp_at_sample_token",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "ah_mcp_rt_sample_refresh",
  "scope": "read write"
}
```

### `POST /api/oauth/revoke`

- **Summary:** Token revocation (RFC 7009)
- **Description:** Revokes an access token or refresh token. Revoking a refresh token immediately invalidates the entire assistant grant and all associated tokens.

**Request Body:**
```json
{
  "token": "ah_mcp_rt_sample_refresh",
  "token_type_hint": "refresh_token",
  "client_id": "cli_0123456789abcdef"
}
```

**Response Example:**
```json
{
  "success": true
}
```

## Direct Web Requests

All web endpoints require an `Authorization: Bearer <API_KEY>` header. OpenAPI 3.1 specification (unauthenticated JSON): [https://aisenhour.com/api/openapi.json](https://aisenhour.com/api/openapi.json).

### `GET /v1/summary`

- **Summary:** Get matrix summary briefing
- **Scope Required:** `read`
- **Description:** Returns count of active tasks across all four quadrants (doFirst, decide, delegate, delete), upcoming scheduled tasks, and active items in Do First and Delegate (includes board tasks when permitted).

**Curl Example:**
```bash
curl -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  https://aisenhour.com/api/v1/summary
```

**Response Example:**
```json
{
  "success": true,
  "totalActiveTasks": 11,
  "upcomingTasksCount": 1,
  "quadrantCounts": {
    "doFirst": 3,
    "decide": 5,
    "delegate": 2,
    "delete": 1
  },
  "doFirstTasks": [
    {
      "id": "tsk_101",
      "title": "Finalize Q4 forecast",
      "dueDate": "2026-11-15"
    }
  ],
  "delegateTasks": [
    {
      "id": "tsk_123456789",
      "title": "Audit third-party dependencies",
      "pendingSubtasks": 1
    }
  ]
}
```

### `GET /v1/agent-tasks`

- **Summary:** Retrieve tasks enabled for assistant pickup across any quadrant
- **Scope Required:** `read`
- **Description:** Returns actionable tasks across any quadrant (doFirst, decide, delegate, delete) assigned to the calling assistant with pickup enabled.
- **Query Parameters:** quadrant (doFirst, decide, delegate, delete)

**Curl Example:**
```bash
curl -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  https://aisenhour.com/api/v1/agent-tasks?quadrant=delegate
```

**Response Example:**
```json
{
  "success": true,
  "count": 1,
  "tasks": [
    {
      "id": "tsk_123456789",
      "title": "Audit third-party dependencies",
      "quadrant": "delegate",
      "category": "Work",
      "agentPickup": true,
      "subtasks": [
        {
          "id": "sub_1",
          "text": "Run license scanner",
          "checked": false
        }
      ]
    }
  ]
}
```

### `GET /v1/delegate-queue`

- **Summary:** Retrieve tasks in delegate queue
- **Scope Required:** `read`
- **Description:** Returns tasks in the Delegate quadrant assigned to the calling assistant, plus unassigned claimable tasks when canClaim is enabled.

**Curl Example:**
```bash
curl -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  https://aisenhour.com/api/v1/delegate-queue
```

**Response Example:**
```json
{
  "success": true,
  "queueCount": 1,
  "tasks": [
    {
      "id": "tsk_123456789",
      "title": "Audit third-party dependencies",
      "category": "Work",
      "description": "Check package.json for outdated licenses",
      "subtasks": [
        {
          "id": "sub_1",
          "text": "Run license scanner",
          "checked": false
        }
      ],
      "agentPickup": true,
      "claimable": false
    }
  ]
}
```

### `GET /v1/tasks`

- **Summary:** List tasks enabled for pickup
- **Scope Required:** `read`
- **Description:** Lists tasks assigned to the assistant with pickup enabled (or active board tasks across quadrants when whole-board reading is enabled). Supports filtering by quadrant, category, lifecycle, or completion status.
- **Query Parameters:** quadrant (doFirst, decide, delegate, delete), category (Work, Finance, Personal, Health, Education, Travel, Shopping, Other), lifecycle (active, archived), status (open, completed, all), include_scheduled (true/false), include_completed (true/false)

**Curl Example:**
```bash
curl -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  https://aisenhour.com/api/v1/tasks?status=open
```

**Response Example:**
```json
{
  "success": true,
  "count": 1,
  "tasks": [
    {
      "id": "tsk_123456789",
      "title": "Draft quarterly report outline",
      "quadrant": "delegate",
      "category": "Work",
      "lifecycle": "active"
    }
  ]
}
```

### `POST /v1/tasks`

- **Summary:** Create a new task
- **Scope Required:** `write`
- **Description:** Creates a new open task on the matrix canvas. Specify assignTo ("me" to capture a human-owned task for the user, or "self" to keep the task for this assistant). Human-owned tasks ("me") count toward the user's active-task plan limit and return { id, title }. Tasks created with "self" default to agentPickup: true and are bound to that assistant.
- **Allowed Body Fields:** `title`, `description`, `quadrant`, `category`, `lifecycle`, `order`, `subtasks`, `dueDate`, `scheduledFor`, `recurring`, `agentPickup`, `assignedAgentKeyId`, `addedByAgentName`, `addedByAgentKeyId`, `source`, `createdVia`, `externallyModified`, `invitedBy`, `sharedWith`, `inviteId`, `sharingRevoked`, `commentsCount`, `unreadComments`, `sentBackCount`, `doneWhen`, `constraints`, `assignee`, `isExpanded`, `assignTo`

**Request Body:**
```json
{
  "assignTo": "me",
  "title": "Review supplier contract",
  "quadrant": "delegate",
  "category": "Work",
  "description": "Check renewal terms and notice periods",
  "subtasks": [
    "Compare 2026 rates",
    "Draft counter-offer email"
  ]
}
```

**Curl Example:**
```bash
curl -X POST -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"assignTo": "me", "title": "Review supplier contract", "quadrant": "delegate", "subtasks": ["Compare 2026 rates", "Draft counter-offer email"]}' \
  https://aisenhour.com/api/v1/tasks
```

**Response Example:**
```json
{
  "id": "tsk_987654321",
  "title": "Review supplier contract"
}
```

### `GET /v1/tasks/:taskId`

- **Summary:** Get single task details
- **Scope Required:** `read`
- **Description:** Retrieves full details of a specific task by ID if assigned to the calling assistant with pickup enabled (or active board task when whole-board reading is enabled).

**Curl Example:**
```bash
curl -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  https://aisenhour.com/api/v1/tasks/tsk_123456789
```

**Response Example:**
```json
{
  "success": true,
  "task": {
    "id": "tsk_123456789",
    "title": "Draft quarterly report outline",
    "quadrant": "delegate",
    "category": "Work",
    "subtasks": [
      {
        "id": "sub_1",
        "text": "Outline key highlights",
        "checked": true
      }
    ]
  }
}
```

### `PATCH /v1/tasks/:taskId`

- **Summary:** Update task fields, quadrant, or subtasks
- **Scope Required:** `write`
- **Description:** Updates mutable task fields (such as title, description, quadrant, category, subtasks, dueDate, scheduledFor, or recurring) on a task assigned to the assistant.
- **Allowed Body Fields:** `title`, `description`, `quadrant`, `category`, `lifecycle`, `order`, `completedAt`, `subtasks`, `dueDate`, `scheduledFor`, `recurring`, `commentsCount`, `unreadComments`, `sentBackCount`, `doneWhen`, `constraints`, `assignee`, `isExpanded`

**Request Body:**
```json
{
  "quadrant": "doFirst",
  "subtasks": [
    {
      "id": "sub_1",
      "text": "Outline key highlights",
      "checked": true
    }
  ]
}
```

**Curl Example:**
```bash
curl -X PATCH -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"quadrant": "doFirst"}' \
  https://aisenhour.com/api/v1/tasks/tsk_123456789
```

**Response Example:**
```json
{
  "success": true,
  "task": {
    "id": "tsk_123456789",
    "title": "Draft quarterly report outline",
    "quadrant": "doFirst",
    "externallyModified": true
  }
}
```

### `DELETE /v1/tasks/:taskId`

- **Summary:** Delete a task
- **Scope Required:** `write`
- **Description:** Permanently deletes an assigned task and cancels any active runs associated with it.

**Curl Example:**
```bash
curl -X DELETE -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  https://aisenhour.com/api/v1/tasks/tsk_123456789
```

**Response Example:**
```json
{
  "success": true,
  "message": "Task tsk_123456789 deleted"
}
```

### `POST /v1/tasks/:taskId/request-input`

- **Summary:** Ask the human a clarifying question
- **Scope Required:** `write`
- **Description:** Asks the task owner a clarifying question about an assigned task, optionally offering quick-choice answer options. Pauses execution and surfaces the question in the user's "Needs you" queue until answered.
- **Allowed Body Fields:** `question`, `options`

**Request Body:**
```json
{
  "question": "Should I focus on enterprise or self-serve accounts?",
  "options": [
    "Enterprise",
    "Self-serve"
  ]
}
```

**Curl Example:**
```bash
curl -X POST -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"question": "Should I focus on enterprise or self-serve accounts?", "options": ["Enterprise", "Self-serve"]}' \
  https://aisenhour.com/api/v1/tasks/tsk_123456789/request-input
```

**Response Example:**
```json
{
  "success": true,
  "question": "Should I focus on enterprise or self-serve accounts?",
  "options": [
    "Enterprise",
    "Self-serve"
  ],
  "assistantQuestion": {
    "question": "Should I focus on enterprise or self-serve accounts?",
    "options": [
      "Enterprise",
      "Self-serve"
    ],
    "askedAt": "2026-11-12T05:00:00.000Z"
  }
}
```

### `POST /v1/tasks/:taskId/progress`

- **Summary:** Report execution progress or delivered results
- **Scope Required:** `write`
- **Description:** Logs an assistant execution update into the task drawer. Specify status: "in_progress" for interim updates or "delivered" for completed work ready for owner review and approval. An alias path /report is also supported.
- **Allowed Body Fields:** `status`, `thought`, `summary`, `deliverable`, `completedSubtaskIds`

**Request Body:**
```json
{
  "status": "delivered",
  "summary": "Finished analysis with full report.",
  "thought": "Analyzed vendor terms and identified 2 clauses to renegotiate.",
  "deliverable": "Drafted counter-offer with recommended redlines.",
  "completedSubtaskIds": [
    "sub_1"
  ]
}
```

**Curl Example:**
```bash
curl -X POST -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status": "delivered", "summary": "Finished analysis with full report."}' \
  https://aisenhour.com/api/v1/tasks/tsk_123456789/progress
```

**Response Example:**
```json
{
  "success": true,
  "taskId": "tsk_123456789",
  "runId": "agent-run-1762776000000"
}
```

### `POST /v1/tasks/:taskId/report`

- **Summary:** Report execution progress and deliverables (alias)
- **Scope Required:** `write`
- **Description:** Legacy alias for /v1/tasks/:taskId/progress. Logs an assistant execution report and deliverable directly into the task drawer, optionally marking subtasks complete.
- **Allowed Body Fields:** `status`, `thought`, `summary`, `deliverable`, `completedSubtaskIds`

**Request Body:**
```json
{
  "status": "delivered",
  "summary": "Finished analysis with full report.",
  "thought": "Analyzed vendor terms and identified 2 clauses to renegotiate.",
  "deliverable": "Drafted counter-offer with recommended redlines.",
  "completedSubtaskIds": [
    "sub_1"
  ]
}
```

**Curl Example:**
```bash
curl -X POST -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status": "delivered", "summary": "Finished analysis with full report."}' \
  https://aisenhour.com/api/v1/tasks/tsk_123456789/report
```

**Response Example:**
```json
{
  "success": true,
  "taskId": "tsk_123456789",
  "runId": "agent-run-1762776000000"
}
```

### `POST /v1/tasks/:taskId/complete`

- **Summary:** Mark task completed
- **Scope Required:** `write`
- **Description:** Marks a non-recurring or recurring task completed. Non-recurring tasks stay in the matrix with completedAt set until explicitly archived.

**Curl Example:**
```bash
curl -X POST -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  https://aisenhour.com/api/v1/tasks/tsk_123456789/complete
```

**Response Example:**
```json
{
  "success": true,
  "recurring": false,
  "task": {
    "id": "tsk_123456789",
    "lifecycle": "active",
    "completedAt": "2026-11-10T12:00:00.000Z"
  }
}
```

### `POST /v1/tasks/:taskId/archive`

- **Summary:** Archive task
- **Scope Required:** `write`
- **Description:** Moves a task from active matrix views into the Archive by setting lifecycle to archived.

**Curl Example:**
```bash
curl -X POST -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  https://aisenhour.com/api/v1/tasks/tsk_123456789/archive
```

**Response Example:**
```json
{
  "success": true,
  "task": {
    "id": "tsk_123456789",
    "lifecycle": "archived"
  }
}
```

### `GET /v1/tasks/:taskId/comments`

- **Summary:** List task notes and comments
- **Scope Required:** `read`
- **Description:** Retrieves private or shared thread comments associated with an assigned task.
- **Query Parameters:** target (private, shared — defaults to private)

**Curl Example:**
```bash
curl -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  https://aisenhour.com/api/v1/tasks/tsk_123456789/comments
```

**Response Example:**
```json
{
  "success": true,
  "comments": [
    {
      "id": "cmt_1",
      "text": "Need this done before Thursday meeting.",
      "createdAt": "2026-11-10T12:00:00Z"
    }
  ]
}
```

### `POST /v1/tasks/:taskId/comments`

- **Summary:** Add a task note or comment
- **Scope Required:** `write`
- **Description:** Appends a note or progress remark to a task thread (defaults to private thread).
- **Allowed Body Fields:** `text`, `target`

**Request Body:**
```json
{
  "text": "Initial research completed. Preparing options outline.",
  "target": "private"
}
```

**Curl Example:**
```bash
curl -X POST -H "Authorization: Bearer YOUR_AH_LIVE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Initial research completed", "target": "private"}' \
  https://aisenhour.com/api/v1/tasks/tsk_123456789/comments
```

**Response Example:**
```json
{
  "success": true,
  "comment": {
    "id": "cmt_2",
    "text": "Initial research completed. Preparing options outline.",
    "authorKind": "agent"
  }
}
```

## Matrix Quadrants

- **`doFirst` (Do First):** Urgent & Important. Critical deadlines, crises, and pressing emergencies that demand immediate focus.
- **`decide` (Decide (Schedule)):** Not Urgent & Important. Strategic planning, high-leverage projects, learning, and proactive growth.
- **`delegate` (Delegate):** Urgent & Not Important. Tasks to assign to coworkers or hand off to personal AI assistants.
- **`delete` (Delete (Eliminate)):** Not Urgent & Not Important. Low-value tasks, distractions, and clutter that should be eliminated.

## Task Categories

- `Work`
- `Finance`
- `Personal`
- `Health`
- `Education`
- `Travel`
- `Shopping`
- `Other`

## Limits and Rules

- **Task Title:** Maximum 120 characters.
- **Task Description:** Maximum 2000 characters.
- **Checklist Subtasks:** Maximum 50 subtasks per task, each up to 500 characters.
- **Task Assignee:** Maximum 100 characters.
- **Progress Report Deliverable:** Maximum 10000 characters.
- **Task Notes & Comments:** Maximum 2000 characters.

## Plan Access and Pricing

- **Free Plan:** Up to 25 active tasks, 3 Built-in Task Planner run/day, 3 Built-in Next Hour Focus run/day, 1 Built-in Delegate Agent runs/day.
- **Pro Plan:** Unlimited active tasks, 15 Built-in Task Planner runs/day, 10 Built-in Next Hour Focus runs/day, 3 Built-in Delegate Agent runs/day.
- **External Assistant Connection:** Free on all plans (Free and Pro). Assistants use your own provider tokens.
