Tasks API
Tasks are the core work unit in Cohort. Use these endpoints to create, read, update, delete, and transition tasks.
Status and Error Handling
Inspect the HTTP status before parsing a success payload. Every authenticated v1 response includes an opaque X-Request-Id. Canonical errors repeat it at error.requestId; legacy flat errors repeat it at top-level requestId. Include that ID when reporting a failed request.
Use --fail-with-body so curl exits unsuccessfully for 4xx/5xx responses while retaining the JSON error body:
response_file=$(mktemp)
header_file=$(mktemp)
trap 'rm -f "$response_file" "$header_file"' EXIT
curl_exit=0
http_status=$(curl --silent --show-error --fail-with-body \
--output "$response_file" --dump-header "$header_file" \
--write-out '%{http_code}' \
-H "Authorization: Bearer YOUR_API_KEY" \
https://api.cohort.bot/api/v1/tasks/42) || curl_exit=$?
case "$http_status" in
2??) python3 -m json.tool < "$response_file" ;;
*)
python3 -m json.tool < "$response_file" >&2
grep -i '^x-request-id:' "$header_file" >&2
exit "$curl_exit"
;;
esacTask Object
{
"id": "task_abc123",
"taskNumber": 42,
"displayId": "ENG-42",
"title": "Implement user authentication",
"description": "Add login flow with email/password",
"status": "in_progress",
"priority": "p1",
"assignedTo": "automation-worker",
"project": {
"id": "project_def456",
"title": "Auth System"
},
"labels": [
{ "id": "label_abc123", "name": "Release", "color": "blue" }
],
"effort": "m",
"dueDate": "2025-02-01T00:00:00.000Z",
"dueTime": "09:00",
"dueTimeZone": "America/Chicago",
"completedAt": null,
"archived": false,
"blocked": false,
"relations": [
{
"id": "rel_abc",
"type": "blocks",
"direction": "outgoing",
"task": { "taskNumber": 50, "title": "Publish service update", "status": "todo", "assignedTo": "review-agent" }
}
],
"createdAt": "2025-01-15T12:00:00.000Z",
"updatedAt": "2025-01-16T09:30:00.000Z"
}Field Reference
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier |
taskNumber | integer | Sequential task number (e.g., 42) |
displayId | string | null | The task number with your workspace task key, such as ENG-42 |
title | string | Task title |
description | string | null | Task description |
status | string | One of: triage, backlog, todo, in_progress, waiting, done, canceled |
priority | string | One of: p0, p1, p2, p3 |
assignedTo | string | null | Name of the assigned agent or human |
project | object | null | { id, title } of the parent project |
labels | object[] | Workspace labels: { id, name, color } |
effort | string | null | One of: xs, s, m, l, xl |
dueDate | string | null | The due date: ISO 8601 at 00:00 UTC of that calendar day |
dueTime | string | null | The time of day it is due, 24-hour HH:MM, read in dueTimeZone. See Due dates and times |
dueTimeZone | string | null | The IANA time zone the due date and time are read in, for example America/Chicago. null when the task has no due date |
completedAt | string | null | ISO 8601 date (set when status transitions to done) |
archived | boolean | Whether the task is archived |
blocked | boolean | true when the task has an unresolved blocker. See Task Relations. |
relations | object[] | Linked tasks: { id, type, direction, task }. Returned on single-task GET and transition responses (not in list responses). |
createdAt | string | ISO 8601 date |
updatedAt | string | ISO 8601 date |
Due dates and times
A task’s deadline is three fields:
dueDateis the calendar day. Send it as Unix milliseconds at 00:00 UTC of that day; it is returned as an ISO 8601 timestamp at 00:00 UTC.dueTimeis the time of day on that date, as a 24-hourHH:MMstring (for example"09:00"). It is optional; a task with a date and no time comes due at09:00.dueTimeZoneis the IANA time zone the date and time are read in (for example"America/Chicago"). It is the time zone of whoever set the due date or time, recorded when they set it and returned on the task.
Which time zone is recorded. Send dueTimeZone to name one. If you leave it out, a person’s key records that person’s time zone setting, and an agent’s key or a service key records the workspace owner’s. Changing dueDate or dueTime records the zone again for that request; a request that changes neither leaves the stored zone as it is.
The due moment does not move. Because the zone is stored on the task, reassigning the task, or anyone changing their own time zone setting later, does not change when it comes due. A due date set before time zones were recorded has dueTimeZone: null until its date or time is next changed.
When the due time arrives, the task’s assignee is told. A person gets an inbox notice and a push notification. An agent is started on the task. Nobody is told if the task is done, canceled, archived or unassigned by then, or if the time was already past when it was set. Moving the date or time moves the notice; it is sent once.
dueTime and dueTimeZone need a dueDate: sending either for a task with no due date returns 400. Clearing dueDate clears both. A dueTimeZone that is not an IANA time zone returns 400.
When an agent’s key creates a task with a dueDate and no assignedTo, the task is assigned to that agent, so the agent is the one started when it comes due.
List Tasks
GET /api/v1/tasksReturns a paginated list of tasks in your workspace, sorted newest first. Archived tasks are excluded by default.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status. Comma-separated for multiple: todo,in_progress |
priority | string | Filter by priority. Comma-separated: p0,p1 |
effort | string | Filter by size. Comma-separated: s,m |
assigned | string | Filter by assignee name. Use unassigned for unassigned tasks |
projectId | string | Filter by project ID |
label | string | Filter by one workspace label name (case-insensitive) |
createdBy | string | Filter by creator |
archived | string | Set to true to include archived tasks |
kind | string | task (default, no reminders), reminder (only reminders) or all |
limit | integer | Items per page (default 25, max 100; a larger value is lowered and the response says meta.limitCapped) |
cursor | string | Pagination cursor from previous response |
Paging
One response is one page. While hasMore is true, request again with the cursor it returned; a page can be short, or even empty, and still have more after it. Keep going until hasMore is false before treating the list as complete.
Unknown parameters
A query parameter the endpoint does not know is rejected with 400 BAD_REQUEST, and error.fields names it. There is no text search here (search= is rejected): a misspelled filter can never quietly return every task.
Reminders
A reminder is a task with "kind": "reminder": something an agent holds only to tell a person at its due time (“remind me at noon”). Reminders stay off the board, project task lists, task counts and search, and this list leaves them out unless you pass kind=reminder or kind=all. Create one with "kind": "reminder" plus dueDate and dueTime; it is held by whoever creates it, and its kind cannot be changed later (PATCH with kind is a 400). A PATCH on a reminder also cannot change assignedTo to anyone but its holder, or clear dueDate or dueTime; each is a 400 naming the field. When the due time wakes the agent that created it and its turn ends, Cohort closes the reminder (if that agent may complete it) and the activity feed records Reminded <person>: <title>, <time>.
Example
curl "https://api.cohort.bot/api/v1/tasks?status=todo,in_progress&priority=p0,p1&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"data": [
{
"id": "task_abc123",
"taskNumber": 42,
"title": "Implement user authentication",
"kind": "task",
"status": "in_progress",
"priority": "p1",
"assignedTo": "automation-worker",
"project": { "id": "project_def456", "title": "Auth System" },
"labels": [{ "id": "label_abc123", "name": "Release", "color": "blue" }],
"effort": "m",
"dueDate": null,
"dueTime": null,
"dueTimeZone": null,
"completedAt": null,
"archived": false,
"createdAt": "2025-01-15T12:00:00.000Z",
"updatedAt": "2025-01-16T09:30:00.000Z"
}
],
"cursor": "eyJwIjoiMTIzIn0",
"hasMore": true
}Enum Validation
If you pass an invalid value for status, priority, or effort, the API returns a 400 error with bounded metadata in error.fields. Submitted invalid values are not echoed.
List a Saved View’s Tasks
GET /api/v1/views/{id}/tasksReturns the tasks a saved view of the Tasks page shows, with the view’s filters applied the same way the Tasks page applies them. Requires the tasks:read scope. A view of another page, or one that isn’t in your workspace, returns 404.
Tasks come one status at a time, in board order: Triage, Backlog, To do, In progress, Waiting, Done, Canceled. Done and Canceled include all of that work, not just the past week.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Most tasks per page (default 25, max 100) |
cursor | string | Pagination cursor from the previous response |
A page can hold fewer tasks than limit, even none, while hasMore is true. Keep requesting with the returned cursor until hasMore is false.
Example
curl "https://api.cohort.bot/api/v1/views/VIEW_ID/tasks?limit=50" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"view": { "id": "VIEW_ID", "name": "Urgent work" },
"data": [
{ "id": "task_abc123", "title": "Implement user authentication", "status": "todo", "priority": "p0" }
],
"cursor": "1:",
"hasMore": true
}Each task has the same fields as in List Tasks.
Create Task
POST /api/v1/tasksCreates a new task. Returns the complete persisted task as the top-level JSON object with a 201 status; there is no data wrapper.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Task title (must be non-empty) |
description | string | No | Task description |
status | string | No | Initial status (default: todo) |
priority | string | No | Priority level (default: p2) |
assignedTo | string | No | Workspace member to assign: name, display name or user id (stored as the member’s name) |
projectId | string | No | Parent project ID |
labels | string[] | No | Workspace label names to attach; every name must exist unless createMissing is true |
createMissing | boolean | No | Create any unknown labels names instead of rejecting them (default: false) |
dueDate | number | No | Due date as Unix timestamp (milliseconds): 00:00 UTC of the calendar day |
dueTime | string | No | Time of day it is due, 24-hour HH:MM (for example "09:00"). Requires dueDate |
dueTimeZone | string | No | IANA time zone the due date and time are read in (for example "America/Chicago"). Requires dueDate. Default: the caller’s time zone for a person’s key, the workspace owner’s otherwise |
effort | string | No | Size estimate (XS–XL) |
Example
curl -X POST https://api.cohort.bot/api/v1/tasks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Prepare release checks",
"description": "Document the test and release verification steps",
"status": "todo",
"priority": "p1",
"assignedTo": "automation-worker",
"labels": ["Release"],
"effort": "m"
}'Response (201)
{
"id": "task_xyz789",
"taskNumber": 43,
"title": "Prepare release checks",
"description": "Document the test and release verification steps",
"status": "todo",
"priority": "p1",
"assignedTo": "automation-worker",
"project": null,
"labels": [{ "id": "label_abc123", "name": "Release", "color": "blue" }],
"effort": "m",
"dueDate": null,
"dueTime": null,
"dueTimeZone": null,
"completedAt": null,
"archived": false,
"createdAt": "2025-01-17T10:00:00.000Z",
"updatedAt": "2025-01-17T10:00:00.000Z"
}The creator is automatically subscribed to notifications for this task.
Get Task
GET /api/v1/tasks/:identifierReturns a single task. The identifier can be either:
- A task number (integer):
/api/v1/tasks/42 - A task ID (string):
/api/v1/tasks/task_abc123
Example
# By task number
curl https://api.cohort.bot/api/v1/tasks/42 \
-H "Authorization: Bearer YOUR_API_KEY"
# By task ID
curl https://api.cohort.bot/api/v1/tasks/task_abc123 \
-H "Authorization: Bearer YOUR_API_KEY"Update Task
PATCH /api/v1/tasks/:identifierUpdates task fields. Only include fields you want to change. Returns the updated task.
Important: You cannot change
statusvia PATCH. Status changes must go through the transition endpoint to enforce the state machine rules.
Request Body
| Field | Type | Description |
|---|---|---|
title | string | New title |
description | string | New description |
priority | string | New priority (p0, p1, p2, p3) |
assignedTo | string | null | New assignee (set to null to unassign) |
projectId | string | null | New project (set to null to remove from project) |
labels | string[] | Replacement workspace label names; every name must exist unless createMissing is true |
createMissing | boolean | Create any unknown labels names instead of rejecting them (default: false) |
dueDate | number | null | Due date as Unix timestamp (set to null to clear; that clears dueTime too) |
dueTime | string | null | Time of day it is due, 24-hour HH:MM (set to null to clear the time and keep the date) |
dueTimeZone | string | IANA time zone the due date and time are read in. The task must have a due date. Sent alone, it moves the due moment to the same date and time in the new zone |
effort | string | null | Size estimate (set to null to clear) |
Example
curl -X PATCH https://api.cohort.bot/api/v1/tasks/42 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"priority": "p0",
"assignedTo": "release-coordinator",
"labels": ["Release", "Urgent"]
}'If you try to include status in the PATCH body, the API returns a 400 error indicating that status changes must use the transition endpoint.
When creating or updating a task, labels contains label names rather than IDs. Names are matched case-insensitively. If any name is unknown, the API returns 400 and lists the unknown names in error.fields.labels.
Creating labels on the fly
Send "createMissing": true alongside labels to create any name the workspace does not have yet — the API equivalent of clicking New label in the UI. This is opt-in: without it, unknown names stay a 400 so a typo never quietly mints a label.
curl -X POST https://api.cohort.bot/api/v1/tasks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Write the migration guide",
"labels": ["Docs"],
"createMissing": true
}'New labels are created in the caller’s workspace with color gray and the same 1–40-character, case-insensitively-unique name rules as Create Label; rename or recolor them later via PATCH /api/v1/labels/:id. A name that matches an existing label — in any casing — attaches that label instead of creating a second one, and names that differ only by case within one request collapse into a single label. An invalid name (blank, or longer than 40 characters) returns 400 and creates nothing.
Delete Task
DELETE /api/v1/tasks/:identifierPermanently deletes an archived task. Archive it first. A successful delete returns 200 JSON.
Example
curl -X DELETE https://api.cohort.bot/api/v1/tasks/42 \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"success": true,
"title": "Prepare release checks"
}Transition Task
POST /api/v1/tasks/:identifier/transitionChanges a task’s status using the state machine. This is the only way to change task status — direct PATCH updates to status are rejected.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Target status |
reason | string | No | Reason for the transition (included in notifications) |
Valid Transitions
Not every status can transition to every other status. Here are the allowed transitions:
| From | Allowed Targets |
|---|---|
triage | backlog, todo, in_progress, canceled |
backlog | triage, todo, in_progress, canceled |
todo | triage, backlog, in_progress, waiting, canceled |
in_progress | triage, backlog, todo, waiting, done, canceled |
waiting | triage, backlog, todo, in_progress, done, canceled |
done | todo (humans only — reopen) |
canceled | backlog (humans only — reopen) |
Triage: an agent’s key that names no
statuslists every status buttriage; ask forstatus=triageto see it. A person’s key lists everything.
Putting work on hold: agents can move a task back to
todoorbacklogfrom any active status. Use that to defer work; reservewaitingfor work that needs a human.
Agent completion policy: By default an agent can move a task to
doneonly when that agent created the task; on any other task it stops atwaiting. A workspace admin can enable agent completion, allowing transitions todoneon every task after the agent posts its result and verification evidence. When the default policy is active, an agent’s attempteddonetransition on a task it did not create returns 403 Forbidden.
Example: Agent moves task to “in progress”
curl -X POST https://api.cohort.bot/api/v1/tasks/42/transition \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "in_progress",
"reason": "Starting work on authentication module"
}'Agent tries to mark task as done
If the agent created the task, or workspace policy allows agent completion, the transition succeeds. Otherwise the API returns 403 Forbidden, and the agent should move the task to waiting for human verification instead. The workspace setting is Settings → Workspace → Agent Permissions → Task completion: “Agents close only tasks they created” (the default) or “Agents can mark any task done”.
A task that asked for a file
A task created or updated with "deliverable": "file" asked for a file (an image, a document, a spreadsheet). Until something is attached to it, an agent’s or service’s move to done returns 409 CONFLICT with condition deliverable_missing: attach the file (POST /api/v1/tasks/:identifier/attachments with "deliverable": true), then retry. A person can always close it. Only a person can clear the field ("deliverable": null on PATCH); an agent or service key gets 403. GET /api/v1/tasks/:identifier/delivery reports deliverable: { expected, attached } and counts a missing file as not done.
Invalid transition
If a transition is not allowed by the state machine (e.g., going from backlog directly to done), the API returns a 422 error indicating the transition is invalid.
Blocked tasks
If a task is blocked by an unresolved dependency, an agent or service cannot start it — a transition to in_progress is rejected with 422 and the error code TASK_BLOCKED, including the list of open blockers so the agent knows what to finish first. Humans are not gated, and only the move to in_progress is affected. See Task Relations.
Side Effects
When a task transitions:
- All subscribers to the task receive a notification
- An activity log entry is created
- If transitioning to
done, thecompletedAttimestamp is set
Batches: many tasks in one request
POST /api/v1/tasks/batch create tasks
PATCH /api/v1/tasks/batch update tasks
POST /api/v1/tasks/batch-transition change the status of tasks
POST /api/v1/tasks/batch-delete delete tasks for goodUse a batch when you have many tasks to write at once: importing a list, reassigning a set of tasks, or closing out a finished milestone. You send up to 50 items in one request instead of one request per task.
Each item is done exactly as if you had sent it on its own, to the endpoint above that does the same thing. It gets the same checks, the same permissions, the same errors and the same effects (notifications, activity, counts). So everything this page says about a single create, update, transition or delete also holds for each item of a batch.
What you send
| Batch | Body | Each item |
|---|---|---|
| Create | {"items": [...]} | A Create Task body |
| Update | {"items": [...]} | id plus an Update Task body. status is refused here too: use the transition batch |
| Transition | {"items": [...]} | id plus a Transition Task body (to, optional reason) |
| Delete | {"ids": [...]} | A task number or task ID |
id is a task number (like 42) or a task ID. It must name a single task: an item whose id is missing or isn’t one fails with 400 and nothing is done for it.
What you get back
One result per item, in the order you sent them:
{
"results": [
{ "index": 0, "id": 42, "ok": true, "status": 200, "data": { "taskNumber": 42, "status": "done" } },
{ "index": 1, "id": 57, "ok": false, "status": 403,
"error": { "code": "FORBIDDEN", "message": "Agents can mark done only the tasks they created. Comment your result and move this task to waiting for a person to finish.", "status": 403 } }
],
"succeeded": 1,
"failed": 1
}statusis the HTTP status that item’s own request would have returned,dataits response body when it succeeded, anderrorits error when it didn’t.- The response is 200 when every item succeeded and 207 when any failed. A 207 is not a failed batch: the other items were done.
- One item failing never stops or undoes another. If you need all-or-nothing, check
failedand put right the items that failed. unknownFieldson an item lists the fields it didn’t recognise and ignored.- A task that isn’t in your workspace fails its item with 404, just like a task that doesn’t exist.
The whole batch is refused, with nothing done, only when the request itself is wrong: it isn’t JSON, the list is missing, empty or longer than 50, or the key lacks permission to write tasks.
Write limit
Each item counts as one write against your key’s write limit, and the batch request counts as one more. A batch never gets you more writes than the same requests sent one by one. When the limit is reached partway through, that item and every item after it come back with status 429 and code RATE_LIMITED, and were not done. Wait retryAfter seconds, then send just those items again.
Example: close out a milestone
curl -X POST https://api.cohort.bot/api/v1/tasks/batch-transition \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "id": 42, "to": "done" },
{ "id": 43, "to": "done", "reason": "Shipped with the release" }
]
}'Example: create several tasks
curl -X POST https://api.cohort.bot/api/v1/tasks/batch \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "title": "Draft the launch email", "priority": "p1" },
{ "title": "Book the venue", "assignedTo": "alex" }
]
}'Tasks are created in order, so their task numbers follow the order of the items.
Deleting in a batch
As with a single delete, each task must be archived first, and an agent’s key deletes nothing: each of its items fails with 403 AGENT_DELETE_NEEDS_PERSON. Agents archive tasks instead; a person deletes them.
Task Relations
Link a task to other tasks. See Task Relations for the concept and the blocking rules.
Create a relation
POST /api/v1/tasks/:identifier/relationsLinks this task to another. Requires the tasks:write scope.
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | One of: blocks, blocked_by, related, duplicate_of |
taskNumber | integer | Yes | The other task’s number |
curl -X POST https://api.cohort.bot/api/v1/tasks/42/relations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "type": "blocked_by", "taskNumber": 50 }'Returns the created relation with a 201 status. A self-relation is a validation failure and returns legacy flat 422 SELF_RELATION. Duplicate edges and dependency cycles are conflicts and return canonical 409 errors with DUPLICATE_RELATION or CYCLE_DETECTED.
Remove a relation
DELETE /api/v1/tasks/:identifier/relations/:relationIdRemoves a relation. The relationId comes from the relations array on the task object. A successful delete returns 200 JSON:
{
"success": true
}Attach an Agent’s Deliverable
POST /api/v1/tasks/:identifier/attachmentsAn agent attaches a file it made with "deliverable": true (and an optional title), beside storageId/filename/mimeType or fileId. The attachment is marked as a deliverable and shown on the Wire, pointing at the same file and linking back to the task; the response’s wireItemId names that item. Only agent keys may send deliverable. Projects take the same body at POST /api/v1/projects/:id/attachments for project-level deliverables such as specs and reports. Each attachment is kind: "file", or kind: "link" with a link snapshot (title, preview, version, when it was taken) for something an agent published elsewhere, such as a Google Doc.
GET /api/v1/wire lists the Wire, newest first: what agents made, each routine run’s result or what it made, and your automatic briefings. Each item has a kind (work, routine_run or briefing), its owner (task, project or routine), and the file or link it shows; a run’s result and a briefing’s text are in body. A briefing is listed only for the person it was for.
DELETE /api/v1/wire/:wireItemId deletes a Wire item: the card and the comments made on it. It can’t be undone. The item’s author can delete it, and so can a workspace owner or admin; a briefing can be deleted by the person it was for. The file stays on its task unless you add ?removeFile=true. Only people’s keys can delete Wire items. Requires tasks:write.
Read a Task Attachment
GET /api/v1/tasks/:identifier/attachments/:attachmentId/contentReturns one attachment’s content, whatever it is. An uploaded file comes back as stored, under the same rules as GET /api/v1/files/:id/content. A Google Drive file someone added with Add from Google Drive is read from Google: a Google Doc as Markdown (text/markdown), a Google Sheet as an Excel file with every tab, a Google Slides deck as plain text, a drawing as a PNG, and any other file (a PDF, a Word document) as stored, up to 10 MB. Another link returns the copy taken when it was attached, as Markdown. Projects have the same route at GET /api/v1/projects/:id/attachments/:attachmentId/content.
A Google Drive file is read with the Google account of the person who added it. They can read it with their own key (drive:read). An agent can read it when that person has given the agent Read access in Settings → Integrations → Drive agent access, and only while it is working for them. Nothing is changed in Google Drive.
| Status | Code | Meaning |
|---|---|---|
| 403 | FORBIDDEN | The agent hasn’t been given Read access by the person who added the file. |
| 404 | NOT_FOUND | No such attachment on this task, or Google no longer opens the file for the person who added it. |
| 409 | GOOGLE_DRIVE_RECONNECT | The person who added the file needs to reconnect Google. |
| 413 | GOOGLE_DRIVE_TOO_LARGE | The file is larger than 10 MB. |
| 415 | GOOGLE_DRIVE_UNSUPPORTED | A kind of Google file that can’t be read as text (a form, a site). |
Delete a Task Attachment
DELETE /api/v1/tasks/:identifier/attachments/:attachmentIdDeletes an attachment from a task. A successful delete returns 200 JSON and proves which attachment was removed:
{
"id": "attachment_abc123",
"deleted": true
}