# Tasks

Manage tasks within projects

## Get All Project Tasks

 - [GET /tasks](https://api-docs.webwork-tracker.com/api/tasks/gettasks.md): Retrieve all tasks in a specific project. 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 parent_id={id} to get subtasks of a specific task.

## Create New Task

 - [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. Accessible to Owners and Executive Managers.

## Get Single Task

 - [GET /tasks/{taskId}](https://api-docs.webwork-tracker.com/api/tasks/gettask.md): Retrieve detailed information about a specific task.

## Update Task

 - [PUT /tasks/{taskId}](https://api-docs.webwork-tracker.com/api/tasks/updatetask.md): Update an existing task. Accessible to Owners and Executive Managers.

## Delete Task

 - [DELETE /tasks/{taskId}](https://api-docs.webwork-tracker.com/api/tasks/deletetask.md): Delete (soft delete) a task from a project. Accessible to Owners and Executive Managers.

## Get Task Assignees

 - [GET /tasks/{taskId}/assignees](https://api-docs.webwork-tracker.com/api/tasks/gettaskassignees.md): Retrieve all users assigned to a specific task.

## Assign Task to User

 - [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.

## Unassign Task from User

 - [DELETE /tasks/{taskId}/unassign/{userId}](https://api-docs.webwork-tracker.com/api/tasks/unassigntask.md): Remove a user assignment from a task.

## Get All Task Statuses

 - [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. When project_id is supplied, the project's status override is returned; if the project has no override, the workspace defaults are returned. Accessible to Owners and Executive Managers.

## Create New Task Status

 - [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 project has no override yet, one is first materialized as a copy of the current workspace statuses (including any custom or renamed statuses), then the new status is added to it. Otherwise the status is added to the workspace defaults. Accessible to Owners and Executive Managers.

## Get Single Task Status

 - [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. Accessible to Owners and Executive Managers.

## Update Task Status

 - [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. Accessible to Owners and Executive Managers.

## Delete Task Status

 - [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 project_id is supplied, the deletion applies to the project's status override. Accessible to Owners and Executive Managers.

## Get Task Comments

 - [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. project_id is derived from the task and is not a parameter.

## Create Task Comment

 - [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 not a parameter.

## Get Single Task Comment

 - [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.

## Update Task Comment

 - [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.

## Delete Task Comment

 - [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 is derived from the task and is not a parameter.

