Update outlooktask (deprecated)

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Caution

The Outlook tasks API is deprecated and will stop returning data on August 20, 2022. Please use the new To Do API. For more information, see To Do APIs in public preview.

Change writable properties of an Outlook task.

The completedDateTime property can be set by the complete action, or explicitly by a PATCH operation. If you use PATCH to set completedDateTime, make sure you set status to completed as well.

By default, this operation (and the POST, GET, and complete task operations) returns date-related properties in UTC. You can use the Prefer: outlook.timezone header to have all the date-related properties in the response represented in a time zone different than UTC.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Tasks.ReadWrite
Delegated (personal Microsoft account) Tasks.ReadWrite
Application Not supported.

HTTP request

PATCH /me/outlook/tasks/{id}
PATCH /users/{id|userPrincipalName}/outlook/tasks/{id}

Request headers

Name Description
Authorization Bearer {token}. Required.
Prefer: outlook.timezone Specifies the time zone for time properties in the response, which would be in UTC if this header is not specified. Optional.

Request body

In the request body, supply the values for relevant fields that should be updated. Existing properties that are not included in the request body will maintain their previous values or be recalculated based on changes to other property values. For best performance you shouldn't include existing values that haven't changed.

Property Type Description
body itemBody The task body that typically contains information about the task. Note that only HTML type is supported.
categories String collection The categories associated with the task.
changeKey String The version of the task.
completedDateTime dateTimeTimeZone The date in the specified time zone that the task was finished.
createdDateTime DateTimeOffset The date and time when the task was created. By default, it is in UTC. You can provide a custom time zone in the request header. The property value uses ISO 8601 format. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.
dueDateTime dateTimeTimeZone The date in the specified time zone that the task is to be finished.
hasAttachments Boolean Set to true if the task has attachments.
importance string The importance of the event. Possible values are: low, normal, high.
isReminderOn Boolean Set to true if an alert is set to remind the user of the task.
lastModifiedDateTime DateTimeOffset The date and time when the task was last modified. By default, it is in UTC. You can provide a custom time zone in the request header. The property value uses ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.
owner String The name of the person who created the task.
parentFolderId String The unique identifier for the task's parent folder.
recurrence patternedRecurrence The recurrence pattern for the task.
reminderDateTime dateTimeTimeZone The date and time for a reminder alert of the task to occur.
sensitivity string Indicates the level of privacy for the task. Possible values are: normal, personal, private, confidential.
startDateTime dateTimeTimeZone The date in the specified time zone when the task is to begin.
status string Indicates the state or progress of the task. Possible values are: notStarted, inProgress, completed, waitingOnOthers, deferred.
subject String A brief description or title of the task.

Response

If successful, this method returns a 200 OK response code and updated outlookTask object in the response body.

Example

Request

The following example modifies the dueDateTime property and uses the Prefer: outlook.timezone header to specify expressing the date-related properties in the response in Eastern Standard Time (EST).

PATCH https://graph.microsoft.com/beta/me/outlook/tasks/AAMkADA1MTHgwAAA=
Prefer: outlook.timezone="Eastern Standard Time"
Content-type: application/json

{
  "dueDateTime":  {
      "dateTime": "2016-05-06T16:00:00",
      "timeZone": "Eastern Standard Time"
  }
}

Response

Here is an example of the response. Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-type: application/json

{
    "id": "AAMkADA1MTHgwAAA=",
    "createdDateTime": "2016-04-22T18:19:18.9526004-04:00",
    "lastModifiedDateTime": "2016-04-22T18:38:20.5541528-04:00",
    "changeKey": "1/KC9Vmu40G3DwB6Lgs7MAAAIW9XXg==",
    "categories": [
    ],
    "assignedTo": null,
    "body": {
        "contentType": "text",
        "content": ""
    },
    "completedDateTime": null,
    "dueDateTime": {
        "dateTime": "2016-05-06T00:00:00.0000000",
        "timeZone": "Eastern Standard Time"
    },
    "hasAttachments":false,
    "importance": "normal",
    "isReminderOn": false,
    "owner": "Administrator",
    "parentFolderId": "AQMkADA1MTIBEgAAAA==",
    "recurrence": null,
    "reminderDateTime": null,
    "sensitivity": "normal",
    "startDateTime": {
        "dateTime": "2016-05-03T00:00:00.0000000",
        "timeZone": "Eastern Standard Time"
    },
    "status": "notStarted",
    "subject": "Shop for children's weekend"

}