Skip to main content

POST /tasks

Description

Creates a new task and returns a task object with the ID of a new task

The route handles the POST request made to the /tasks path.

HTTP methodRoute
POST/tasks

Payload

The server side expects to receive a json object with the next properties:

NameTypeDescription
targetIdnumberOptional. The ID of the future target task where a new task will be added.
parentnumberOptional. The ID of the parent task.
projectnumberOptional. The ID of the project to which a new task should be added.
reversebooleanOptional. Defines the position where a new task will be added: true, if the task is added before the target task; otherwise, false (default).
taskobjectRequired. The task object an example of which you can find here tasks.

Example:

{
"parent": 10,
"project": 1,
"reverse": false,
"targetId": 10,
"task": {
"text": "My task",
//...other values
}
}

Response

The route returns a json object with the ID of a new task.

Example:

{
"id": 12
}

The HTTP status code shows whether the request succeeds (response.status == 200) or fails (response.status == 500).


Related articles: