Google Apps Platform

Google Apps Tasks API: How to Order Tasks

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:

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.




POST /tasks/v1/lists/@default/tasks/taskID/move?parent=parentTaskID&previous=previousTaskID


HTTP/1.1 200 OK

  id: "taskID",
  kind: "tasks#task",
  selfLink: "",
  etag: "newETag",
  title: "New Task",
  notes: "Please complete me",
  updated: "2010-10-15T11:30:00.000Z",
  parent: "parentTaskID",
  position: "newPosition",



Move move = service.tasks.move("@default", "taskID");
Task result = move.execute();

// Print the new values.


result = service.tasks().move(tasklist='@default', task='taskID', parent='parentTaskID', previous='previousTaskID').execute()

# Print the new values.
print result['parent']
print result['position']


$result = $service->moveTasks('taskID', '@default', null, 'parentTaskID', 'previousTaskID');

 * Print the new values.
echo $result->getParent();
echo $result->getPosition();


Task result = service.Tasks.Move("@default", "taskID",
                                 parent: "parentTaskID", previous: "previousTaskID").Fetch();
// Print the new values.

Note: The parent and previous parameters can also be used while creating a new task.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.