Order Tasks
Stay organized with collections
Save and categorize content based on your preferences.
You can organize tasks in a specific order to suit the user's needs and preferences. A task can be moved under another task (parent
task) and/or move to be after another task (previous
).

To move a task, send an authenticated POST
request to the following URL with these special parameters:
- The
parent
parameter
- Specifies the ID of the parent task under which the new task should be inserted; omitting this parameter places the task in the top level of the list.
- The
previous
parameter
- Specifies the ID of the task after which the new task should be inserted; omitting this parameter places the task in the first position of the sublist.
The URL is of the form:
https://www.googleapis.com/tasks/v1/lists/taskListID
/tasks/taskID
/move?parent=parentTaskID
&previous=previousTaskID
With the appropriate values in place of taskListID
, taskID
, parentTaskID
and previousTaskID
.
Note: The special taskListID
value @default
can be used to refer to the authenticated user's default task list.
Upon success, the server responds with an HTTP 200 OK
status code and the new task data.
Example
Protocol
Request:
POST /tasks/v1/lists/@default/tasks/taskID
/move?parent=parentTaskID
&previous=previousTaskID
Response:
HTTP/1.1 200 OK
{
id: "taskID",
kind: "tasks#task",
selfLink: "https://www.googleapis.com/tasks/v1/lists/@default/tasks/taskID",
etag: "newETag",
title: "New Task",
notes: "Please complete me",
updated: "2010-10-15T11:30:00.000Z",
...,
parent: "parentTaskID",
position: "newPosition",
...
}
Java
import com.google.api.services.tasks.v1.Tasks.TasksOperations.Move;
...
Move move = service.tasks.move("@default", "taskID");
move.setParent("parentTaskID");
move.setPrevious("previousTaskID");
Task result = move.execute();
// Print the new values.
System.out.println(result.getParent());
System.out.println(result.getPosition());
Python
result = service.tasks().move(tasklist='@default', task='taskID', parent='parentTaskID', previous='previousTaskID').execute()
# Print the new values.
print result['parent']
print result['position']
PHP
$result = $service->moveTasks('taskID', '@default', null, 'parentTaskID', 'previousTaskID');
/*
* Print the new values.
*/
echo $result->getParent();
echo $result->getPosition();
.NET
Task result = service.Tasks.Move("@default", "taskID",
parent: "parentTaskID", previous: "previousTaskID").Fetch();
// Print the new values.
Console.WriteLine(result.Parent);
Console.WriteLine(result.Position);
Note: The parent
and previous
parameters can also be used while creating a new task.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[null,null,["Last updated 2025-08-28 UTC."],[],[],null,["# Order Tasks\n\nYou can organize tasks in a specific order to suit the user's needs and preferences. A task can be moved under another task (`parent` task) and/or move to be after another task (`previous`).\n\nTo move a task, send an authenticated `POST` request to the following URL with these special parameters:\n\nThe `parent` parameter\n: Specifies the ID of the parent task under which the new task should be inserted; omitting this parameter places the task in the top level of the list.\n\nThe `previous` parameter\n: Specifies the ID of the task after which the new task should be inserted; omitting this parameter places the task in the first position of the sublist.\n\nThe URL is of the form: \n\n https://www.googleapis.com/tasks/v1/lists/taskListID/tasks/taskID/move?parent=parentTaskID&previous=previousTaskID\n\nWith the appropriate values in place of `taskListID`, `taskID`, `parentTaskID` and `previousTaskID`.\n\n**Note** : The special `taskListID` value `@default` can be used to refer to the authenticated user's default task list.\n\nUpon success, the server responds with an HTTP `200 OK` status code and the new task data.\n\nExample\n=======\n\n### Protocol\n\nRequest: \n\n POST /tasks/v1/lists/@default/tasks/taskID/move?parent=parentTaskID&previous=previousTaskID\n\nResponse: \n\n```http\nHTTP/1.1 200 OK\n\n{\n id: \"taskID\",\n kind: \"tasks#task\",\n selfLink: \"https://www.googleapis.com/tasks/v1/lists/@default/tasks/taskID\",\n etag: \"\u003cvar translate=\"no\"\u003enewETag\u003c/var\u003e\",\n title: \"New Task\",\n notes: \"Please complete me\",\n updated: \"2010-10-15T11:30:00.000Z\",\n ...,\n parent: \"\u003cvar translate=\"no\"\u003eparentTaskID\u003c/var\u003e\",\n position: \"\u003cvar translate=\"no\"\u003enewPosition\u003c/var\u003e\",\n ...\n}\n```\n\n### Java\n\n\n```java\nimport com.google.api.services.tasks.v1.Tasks.TasksOperations.Move;\n...\n\nMove move = service.tasks.move(\"@default\", \"\u003cvar translate=\"no\"\u003etaskID\u003c/var\u003e\");\nmove.setParent(\"\u003cvar translate=\"no\"\u003eparentTaskID\u003c/var\u003e\");\nmove.setPrevious(\"\u003cvar translate=\"no\"\u003epreviousTaskID\u003c/var\u003e\");\nTask result = move.execute();\n\n// Print the new values.\nSystem.out.println(result.getParent());\nSystem.out.println(result.getPosition());\n```\n\n\u003cbr /\u003e\n\n### Python\n\n\n```python\nresult = service.tasks().move(tasklist='@default', task='\u003cvar translate=\"no\"\u003etaskID\u003c/var\u003e', parent='\u003cvar translate=\"no\"\u003eparentTaskID\u003c/var\u003e', previous='\u003cvar translate=\"no\"\u003epreviousTaskID\u003c/var\u003e').execute()\n\n# Print the new values.\nprint result['parent']\nprint result['position']\n```\n\n\u003cbr /\u003e\n\n### PHP\n\n\u003cbr /\u003e\n\n```php\n$result = $service-\u003emoveTasks('\u003cvar translate=\"no\"\u003etaskID\u003c/var\u003e', '@default', null, '\u003cvar translate=\"no\"\u003eparentTaskID\u003c/var\u003e', '\u003cvar translate=\"no\"\u003epreviousTaskID\u003c/var\u003e');\n\n/*\n * Print the new values.\n */\necho $result-\u003egetParent();\necho $result-\u003egetPosition();\n```\n\n\u003cbr /\u003e\n\n### .NET\n\n\u003cbr /\u003e\n\n```transact-sql\nTask result = service.Tasks.Move(\"@default\", \"\u003cvar translate=\"no\"\u003etaskID\u003c/var\u003e\",\n parent: \"\u003cvar translate=\"no\"\u003eparentTaskID\u003c/var\u003e\", previous: \"\u003cvar translate=\"no\"\u003epreviousTaskID\u003c/var\u003e\").Fetch();\n// Print the new values.\nConsole.WriteLine(result.Parent);\nConsole.WriteLine(result.Position);\n```\n\n\u003cbr /\u003e\n\n**Note** : The `parent` and `previous` parameters can also be used while [creating a new task](#creating_task)."]]