Google Tasks API

Tasks: insert

Requires authorization

Creates a new task on the specified task list. Try it now or see an example.


HTTP Request



Parameter Name Value Description
Required Parameters
tasklist string Task list identifier.
Optional Parameters
parent string Parent task identifier. If the task is created at the top level, this parameter is omitted. Optional.
previous string Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional.


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

Task task = new Task();
task.setTitle("New Task");
task.setNotes("Please complete me");
task.setDue(new DateTime(System.currentTimeMillis() + 3600000), 0);

Task result = service.tasks.insert("@default", task).execute();


Uses the PHP client library

$task = new Task();
$task->setTitle('New Task');
$task->setNotes('Please complete me');
$task->setDue(new TaskDateTime('2010-10-15T12:00:00.000Z'));

$result = $service->insertTasks('@default', $task);
echo $result->getId();


Uses the Python client library

task = {
  'title': 'New Task',
  'notes': 'Please complete me',
  'due': '2010-10-15T12:00:00.000Z'

result = service.tasks().insert(tasklist='@default', body=task).execute()
print result['id']


Uses the .NET client library

Task task = new Task { Title = "New Task"};
task.Notes = "Please complete me";
task.Due = "2010-10-15T12:00:00.000Z";

Task result = service.Tasks.Insert(task, "@default").Fetch();

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.