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 stopped returning data on August 20, 2022. Use the To Do API instead.

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.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Tasks.ReadWrite Not available.
Delegated (personal Microsoft account) Tasks.ReadWrite Not available.
Application Not supported. Not supported.

HTTP request

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

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
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

The following example shows 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"

}