Update subscription

Renew a subscription by extending its expiry time.

Subscriptions to resources expire at dates proscribed by the individual resource types. In order not to miss notifications, subscriptions should be renewed well in advance of their expiry date. See subscription for individual expiry dates.

Prerequisites

One of the following scopes, depending on the target resource, are required to execute this API: Mail.Read, Calendars.Read, Contacts.Read, Group.Read.All, Files.ReadWrite, or Files.ReadWrite.All

HTTP request

PATCH /subscriptions/{subscriptionId}

Request headers

Name Type Description
Authorization string Bearer {token}. Required.

Response

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

Example

Request

Here is an example of the request.

PATCH https://graph.microsoft.com/v1.0/subscriptions/{subscriptionId}
Content-type: application/json

{
   "expirationDateTime":"2016-11-22T18:23:45.9356913Z"
}
Response

Here is an example of the response.

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

{
  "id":"7f105c7d-2dc5-4530-97cd-4e7ae6534c07",
  "resource":"me/messages",
  "changeType":"created,updated",
  "clientState":"subscription-identifier",
  "notificationUrl":"https://webhook.azurewebsites.net/api/send/myNotifyClient",
  "expirationDateTime":"2016-11-22T18:23:45.9356913Z"
}