AI Task Manager

API Reference

A small REST API for driving the Task Manager from your own code: create a task, start it, and pull back its status and results.

Authentication

Every request needs an API key sent as a Bearer token. Create one under Settings → API, then include it on every request:

Authorization: Bearer tm_live_...

Keys aren't scoped yet — anyone with a key can create, start, and read any task. Treat it like a password and store it server-side, not in a public client.

Base URL

All endpoints are relative to your own deployment's origin, e.g. http://localhost:3000/api/v1.

Errors

Errors return a non-2xx status with a JSON body shaped like:

{
  "error": {
    "message": "No task found with id '...'.",
    "code": "not_found"
  }
}

Create a task

POST /api/v1/tasks

Creates a task. By default it's queued immediately (autoStart: true) and the worker picks it up on its next poll (within ~5s). Pass autoStart: false to create it disabled and start it later with the start endpoint below.

Review-only tickets: pass reviewOnly: true to create a reminder to review work done somewhere else (a commit pushed by hand, another Claude session) instead of an agent task. It goes straight to In Review (status: 'completed', reviewStatus: 'in_review'), the worker never picks it up and it spends no tokens. The description says what to review and why (e.g. the commit message); attach what to look at in reviewMetadata. Run options (repos, autoStart: false, schedules, teams, dependencies, subtasks) are rejected on it. Approving moves it to Done as usual. Request changes is refused (409) — there's no agent run to continue, so create a normal task on the referenced branch instead. Start/re-run is refused the same way.

Body parameters

NameTypeRequiredDescription
descriptionstringyesWhat the agent should do. The only required field.
titlestringShort title. Derived from the description when omitted.
contextstringExtra background/instructions kept separate from the description.
reposarrayRepos to check out: [{ alias, url, branch? }]. Required unless outputType is 'file', 'design' or 'result'.
outputTypestring'repository' (default), 'file', 'design', or 'result' (agent's answer shown inline on the task page — no files or commits).
prioritystring'low' | 'normal' (default) | 'high' | 'urgent'.
effortstring'low' | 'medium' | 'high' | 'xhigh' | 'max'. Omit to use the provider default.
modelstringOverride model id. Omit to use the configured default.
toolAccessobjectPer-task external tool access, e.g. { "github-cli": true } to let the agent use the GitHub CLI, or false to deny it. Tools left out follow Settings → Agent Tools.
labelsarrayFreeform string labels, e.g. ["bug", "backend"].
pushToMainbooleanPush directly to the default branch instead of opening a PR.
createPRbooleanOpen a pull request when the task finishes.
targetBranchstringBranch to base work/PRs off of. Defaults to the repo's default branch.
tokenBudgetnumberKill the task if it exceeds this many tokens.
costBudgetnumberKill the task if estimated cost exceeds this (USD).
allowSubtasksbooleanLet the agent split the work into follow-up tasks of its own, created when it finishes (e.g. one task per item it discovered). Subtasks inherit this task's repos and settings and can't create further subtasks. Defaults to false.
autoStartbooleanQueue immediately. Defaults to true; pass false to start it later.
notesstringPrivate notes on the task (not shown to the agent).
reviewOnlybooleantrue = a review-only ticket: created straight into In Review, never run by an agent. See above.
reviewMetadataobjectReview-only tickets: { repo?, branch?, commits?, prUrl? }, all optional. repo: a saved repo's URL or any Git URL; branch: a branch name; commits: an array of commit SHAs (7–40 hex chars, short or full, stored as given); prUrl: an http(s) link to the PR. A bad value is a 400 naming the field, e.g. 'reviewMetadata.commits'.

Example request body

{
  "description": "Add a health check endpoint at /api/health that returns { ok: true }.",
  "repos": [
    {
      "alias": "app",
      "url": "https://github.com/your-org/your-repo.git"
    }
  ],
  "priority": "normal",
  "createPR": true
}

Example response (201)

{
  "data": {
    "id": "clx1a2b3c0000",
    "title": "Add a health check endpoint at /api/health...",
    "description": "Add a health check endpoint at /api/health that returns { ok: true }.",
    "status": "pending",
    "outputType": "repository",
    "priority": "normal",
    "effort": null,
    "repos": [
      {
        "alias": "app",
        "url": "https://github.com/your-org/your-repo.git",
        "branch": null
      }
    ],
    "branchName": null,
    "commitSha": null,
    "prUrl": null,
    "prNumber": null,
    "createdAt": "2026-08-01T12:00:00.000Z",
    "updatedAt": "2026-08-01T12:00:00.000Z"
  }
}

Start a task

POST /api/v1/tasks/{id}/start

Queues a task for the worker: sets it enabled, status 'pending', and clears any retry/schedule delay so it's picked up on the very next poll. Mainly for tasks created with autoStart: false, but works on any non-running task — including kicking a failed/paused one back into the queue. Returns 409 if the task is already running.

Path parameters

NameTypeRequiredDescription
idstringyesTask id, from the create-task response.

Example response (200)

{
  "data": {
    "id": "clx1a2b3c0000",
    "status": "pending",
    "updatedAt": "2026-08-01T12:00:05.000Z"
  }
}

Get a task

GET /api/v1/tasks/{id}

Fetches a task's current status and results: branch/commit/PR info for repository tasks, generated files for file/design tasks, and token/cost usage. Pass ?logs=true to include the full run log.

Path parameters

NameTypeRequiredDescription
idstringyesTask id.

Query parameters

NameTypeRequiredDescription
logsbooleanInclude the full TaskLog history. Defaults to false.

Example response (200)

{
  "data": {
    "id": "clx1a2b3c0000",
    "status": "completed",
    "outputType": "repository",
    "branchName": "task/clx1a2b3c0000",
    "commitSha": "a1b2c3d",
    "prUrl": "https://github.com/your-org/your-repo/pull/42",
    "prNumber": 42,
    "inputTokens": 18342,
    "outputTokens": 2110,
    "estimatedCost": 0.41,
    "files": [],
    "updatedAt": "2026-08-01T12:04:32.000Z"
  }
}

Update a task

PATCH /api/v1/tasks/{id}

Edits a task's ticket fields — title, description, context, priority, labels and notes — and, on a review-only ticket, its reviewMetadata. Only the fields you send change; inside reviewMetadata only the keys you send change, and null, "" or [] clears one. Description and context can't change while the task is running. Run settings (repos, provider, schedule, …) are edited from the UI or the MCP update_task tool.

Path parameters

NameTypeRequiredDescription
idstringyesTask id.

Body parameters

NameTypeRequiredDescription
titlestringNew title. Empty falls back to the start of the description.
descriptionstringNew description. Can't be empty.
contextstringNew context; null clears it.
prioritystring'low' | 'normal' | 'high' | 'urgent'.
labelsarrayReplaces the labels; null or [] clears them.
notesstringReplaces the notes; null clears them.
reviewMetadataobjectReview-only tickets: { repo?, branch?, commits?, prUrl? } — same rules as on create.

Example request body

{
  "reviewMetadata": {
    "commits": [
      "65948886",
      "a1b2c3d4e5"
    ],
    "prUrl": "https://github.com/your-org/your-repo/pull/42"
  }
}

Example response (200)

{
  "data": {
    "id": "clx1a2b3c0000",
    "title": "Show the executive summary read-only until the poster chooses Edit",
    "status": "completed",
    "reviewStatus": "in_review",
    "reviewOnly": true,
    "reviewMetadata": {
      "repo": "git@github.com:your-org/your-repo.git",
      "branch": "develop",
      "commits": [
        "65948886",
        "a1b2c3d4e5"
      ],
      "prUrl": "https://github.com/your-org/your-repo/pull/42"
    }
  }
}

List tasks

GET /api/v1/tasks

Lists tasks, most recent first. Recurring templates are excluded.

Query parameters

NameTypeRequiredDescription
qstringFree text found in the title, description or context, or a commit SHA / PR URL (review metadata and agents' commits and PRs).
reviewOnlybooleantrue = only review-only tickets; false = only agent tasks.
statusstringFilter to one status, e.g. 'pending', 'running', 'completed', 'failed'.
limitnumberMax results, 1-100. Defaults to 20.

Example response (200)

{
  "data": [
    {
      "id": "clx1a2b3c0000",
      "title": "Add a health check endpoint",
      "status": "completed"
    }
  ]
}

List a task's output files

GET /api/v1/tasks/{id}/files

Lists the files a task produced in its workspace. Defaults to the output directory, where file and design tasks write their results. Pass ?recursive=true to walk the whole tree in one call instead of a request per directory level.

Path parameters

NameTypeRequiredDescription
idstringyesTask id.

Query parameters

NameTypeRequiredDescription
pathstringDirectory to list, relative to the workspace. Defaults to 'output'.
recursivebooleanWalk subdirectories too. Defaults to false.

Example response (200)

{
  "data": {
    "path": "output",
    "entries": [
      {
        "name": "findings.json",
        "path": "output/findings.json",
        "type": "file",
        "size": 8213,
        "modifiedAt": "2026-08-01T12:04:32.000Z"
      }
    ]
  }
}

Read a task's output file

GET /api/v1/tasks/{id}/files/content

Returns the contents of one text file from a task's workspace. This is how a caller that created a file-output task collects the result: poll GET /api/v1/tasks/{id} until the status is terminal, then read the file the task was asked to write. Binary files and anything over 5MB are refused.

Path parameters

NameTypeRequiredDescription
idstringyesTask id.

Query parameters

NameTypeRequiredDescription
pathstringyesFile path relative to the workspace, e.g. 'output/findings.json'.

Example response (200)

{
  "data": {
    "path": "output/findings.json",
    "content": "{\"findings\": []}",
    "size": 17,
    "modifiedAt": "2026-08-01T12:04:32.000Z"
  }
}