Skip to main content

POST /tasks

Description

Creates a new task

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

Payload

The server needs to receive a JSON object with data for the new task. The description of the task object, see here: tasks property.

{
"text": "New Task",
"parent": 20,
"start": "2024-06-21 00:00:00",
"duration": 1,
"end": "2024-06-22 00:00:00",
"id": "temp://1710851071459",
"progress": 0,
"type": "task",
"details": "", // the description field in the task editor
}

Response

The server returns a JSON object with the new task ID.

Example:

{
"id":13
}

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


Related articles: