Google Tasks API

Tasks: update

Requires authorization

Updates the specified task. Try it now or see an example.


HTTP Request



Parameter Name Value Description
Required Parameters
task string Task identifier.
tasklist string Task list identifier.


This request requires authorization with at least one of the following scopes (read more about authentication and authorization).


Request Body

In the request body, supply a Tasks resource.


If successful, this method returns a Tasks resource in the response body.


Note: The code examples available for this method do not represent all supported programming languages (see the client libraries page for a list of supported languages).


Uses the Java client library

// First retrieve the task to update.
Task task = service.tasks.get("@default", "taskID").execute();

Task result = service.tasks.update("@default", task.getId(), task).execute();
// Print the completed date.


Uses the PHP client library

 * First retrieve the task to update.
$task = $service->getTasks('@default', 'taskID');

$result = $service->updateTasks($task->getId(), '@default', $task);
 * Print the completed date.
echo $result->getCompleted();


Uses the Python client library

# First retrieve the task to update.
task = service.tasks().get(tasklist='@default', task='taskID').execute()
task['status'] = 'completed'

result = service.tasks().update(tasklist='@default', task=task['id'], body=task).execute()
# Print the completed date.
print result['completed']


Uses the .NET client library

// First retrieve the task to update.
Task task = service.Tasks.Get("@default", "taskID").Fetch();
task.Status = "completed";

Task result = service.Tasks.Update(task, "@default", task.Id).Fetch();
// Print the completed date.
Console.WriteLine(XmlConvert.ToDateTime(result.Completed, XmlDateTimeSerializationMode.Utc));

Try It!

Use the explorer below to call this method on live data and see the response. Alternatively, try the standalone explorer.

Authentication required

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

Signing you in...

Google Developers needs your permission to do that.