# Tasks

Manage tasks within projects, with their statuses and comments. Each role reads the tasks its own task list shows and changes those it may edit; every role reads task statuses, and only the Owner and an Executive Manager change them. An Executive Manager with the owner's Tasks restriction gets 403 on all of them.

 - [GET /tasks](https://api-docs.webwork-tracker.com/api/tasks/gettasks.md): Retrieve the tasks of a specific project that your role reaches. You can apply filters by status, priority, or parent_id to narrow down results. Use parent_id=null to get only top-level tasks, or pare
 - [POST /tasks](https://api-docs.webwork-tracker.com/api/tasks/createtask.md): Create a new task or subtask in a project. To create a subtask, provide a parent_id pointing to an existing top-level task. Only one level of nesting is supported. Pass a `recurrence` object to make t
 - [GET /tasks/by-identifier/{identifier}](https://api-docs.webwork-tracker.com/api/tasks/gettaskbyidentifier.md): Retrieve one task by its identifier. The identifier is the task key that the app shows and puts in a task URL, such as `DE6-1279` in `/app/tasks/298108/task/DE6-1279`. Use this endpoint when you have
 - [GET /tasks/{taskId}](https://api-docs.webwork-tracker.com/api/tasks/gettask.md): Retrieve detailed information about a specific task. **Access by role**: as `GET /tasks`; a task outside the caller's list answers 404. Its `subtasks`, `assignees` and assignee emails follow the same
 - [PUT /tasks/{taskId}](https://api-docs.webwork-tracker.com/api/tasks/updatetask.md): Update an existing task. **Access by role**: the task must be one the caller reads (else 404) and may edit (else 403). The Owner and an Executive Manager edit any task. A Project Manager edits the tas
 - [DELETE /tasks/{taskId}](https://api-docs.webwork-tracker.com/api/tasks/deletetask.md): Delete (soft delete) a task from a project. **Access by role**: the task must be one the caller reads (else 404) and may delete (else 403), by the rules of `PUT /tasks/{taskId}`. A Member with only "A
 - [GET /tasks/{taskId}/assignees](https://api-docs.webwork-tracker.com/api/tasks/gettaskassignees.md): Retrieve all users assigned to a specific task. **Access by role**: a task the caller reads, as `GET /tasks`; any other answers 404. The list holds active members only. Emails are null for a Member, e
 - [POST /tasks/{taskId}/assign/{userId}](https://api-docs.webwork-tracker.com/api/tasks/assigntask.md): Assign a task to a specific user. The user must be a member of the project. **Access by role**: the task must be one the caller reads, else 404. The Owner and an Executive Manager assign any active me
 - [DELETE /tasks/{taskId}/unassign/{userId}](https://api-docs.webwork-tracker.com/api/tasks/unassigntask.md): Remove a user assignment from a task. `workspace_id` and `project_id` are required in the request body — `project_id` must be the task's project (same as GET/DELETE task and assign). Returns 404 if th
 - [PUT /tasks/{taskId}/recurrence](https://api-docs.webwork-tracker.com/api/tasks/settaskrecurrence.md): Make a task recurring, or replace its existing repeat schedule. **`PUT` is create-or-replace**: the whole schedule is rewritten from the body — an omitted option falls back to its default, not to its
 - [DELETE /tasks/{taskId}/recurrence](https://api-docs.webwork-tracker.com/api/tasks/removetaskrecurrence.md): Stop a task from repeating. Removes the schedule only — the task itself and every occurrence already created stay untouched. `404` when the task is not in the project **or has no schedule**. Reversibl
 - [GET /task-statuses](https://api-docs.webwork-tracker.com/api/tasks/gettaskstatuses.md): Retrieve all task statuses for a workspace. Status IDs are plain integers where the type group = floor(id / 10): 0 = open, 1 = active, 2 = done, 3 = closed. Built-in statuses are 0, 10, 20, and 30. Wh
 - [POST /task-statuses](https://api-docs.webwork-tracker.com/api/tasks/createtaskstatus.md): Create a new custom task status within a type group. Each type group allows a maximum of 10 statuses. When project_id is supplied, the status is created on the project's status override; if the projec
 - [GET /task-statuses/{statusId}](https://api-docs.webwork-tracker.com/api/tasks/gettaskstatus.md): Retrieve detailed information about a specific task status. When project_id is supplied, the status is resolved from the project's status override, falling back to workspace defaults. **Access by role
 - [PUT /task-statuses/{statusId}](https://api-docs.webwork-tracker.com/api/tasks/updatetaskstatus.md): Update the label and/or color of an existing task status. At least one of text or color must be provided. When project_id is supplied, the update applies to the project's status override. **Access by
 - [DELETE /task-statuses/{statusId}](https://api-docs.webwork-tracker.com/api/tasks/deletetaskstatus.md): Delete a custom task status. Built-in statuses (id % 10 == 0) cannot be deleted. Tasks using the deleted status are moved to reassign_to, or to the group base status when reassign_to is omitted. When
 - [GET /tasks/{task_id}/comments](https://api-docs.webwork-tracker.com/api/tasks/gettaskcomments.md): Retrieve the threaded comments for a task. Only root comments are returned at the top level; each carries its nested replies (threaded via parent_id). workspace_id is required as a query parameter. pr
 - [POST /tasks/{task_id}/comments](https://api-docs.webwork-tracker.com/api/tasks/createtaskcomment.md): Create a comment on a task. Pass parent_id to post a reply within an existing thread; omit it for a top-level comment. workspace_id is required in the body. project_id is derived from the task and is
 - [GET /tasks/{task_id}/comments/{comment_id}](https://api-docs.webwork-tracker.com/api/tasks/gettaskcomment.md): Retrieve a single task comment with its replies and file attachments. workspace_id is required as a query parameter. project_id is derived from the task and is not a parameter. **Access by role**: a t
 - [PUT /tasks/{task_id}/comments/{comment_id}](https://api-docs.webwork-tracker.com/api/tasks/updatetaskcomment.md): Update the text of a task comment. Only the comment author may edit; a 403 is returned otherwise. workspace_id is required in the body. project_id is derived from the task and is not a parameter. **Ac
 - [DELETE /tasks/{task_id}/comments/{comment_id}](https://api-docs.webwork-tracker.com/api/tasks/deletetaskcomment.md): Delete a task comment. Deleting a comment cascades to its replies and attached files. Only the comment author may delete; a 403 is returned otherwise. workspace_id is required in the body. project_id
