Muokkaa

Jaa


Use the Microsoft Graph API to get change notifications

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

Existing apps that use this feature with baseTask or baseTaskList should be updated, as the to-do API set built on these resources is deprecated as of May 31, 2022. That API set will stop returning data on August 31, 2022. Please use the API set built on todoTask.

The Microsoft Graph REST API can deliver change notifications to clients through various endpoints, including webhooks, Event Hubs, and Event Grid. To learn how to subscribe and receive notifications for your application, see Set up notifications for changes in user data.

An app can subscribe to changes on the Microsoft Graph resources listed in the table.

Note

Subscriptions to resources marked with an asterisk (*) are only available on the /beta endpoint.

Resource Supported resource paths Limitations
Cloud printing printer Changes when a print job is ready to be downloaded (jobFetchable event): /print/printers/{id}/jobs -
Cloud printing printTaskDefinition Changes when there's a valid job in the queue (jobStarted event): /print/printtaskdefinition/{id}/tasks -
driveItem on OneDrive (personal) Changes to content within the hierarchy of any folder: /users/{id}/drive/root -
driveItem on OneDrive for work or school Changes to content within the hierarchy of the root folder: /drives/{id}/root , /users/{id}/drive/root -
group Changes to all groups: /groups

Changes to a specific group: /groups/{id}

Changes to owners of a specific group: /groups/{id}/owners

Changes to members of a specific group: /groups/{id}/members
Maximum subscription quotas:
  • Per app (for all tenants combined): 50,000 total subscriptions.
  • Per tenant (for all applications combined): 1,000 total subscriptions across all apps.
  • Per app and tenant combination: 100 total subscriptions.

    Not supported for Azure AD B2C tenants.

    NOTE: Creation and soft-deletion of groups also trigger the updated changeType.
  • list under a SharePoint site Changes to content within the list: /sites/{site-id}/lists/{list-id} -
    Microsoft 365 group conversation Changes to a group's conversations: groups/{id}/conversations -
    Outlook message Changes to all messages in a user's mailbox: /users/{id}/messages , /me/messages

    Changes to messages in a user's Inbox: /users/{id}/mailFolders('inbox')/messages , /me/mailFolders('inbox')/messages
    A maximum of 1,000 active subscriptions per mailbox for all applications is allowed.
    Outlook event Changes to all events in a user's mailbox: /users/{id}/events , /me/events A maximum of 1,000 active subscriptions per mailbox for all applications is allowed.
    Outlook personal contact Changes to all personal contacts in a user's mailbox: /users/{id}/contacts , /me/contacts A maximum of 1,000 active subscriptions per mailbox for all applications is allowed.
    Security alert Changes to a specific alert: /security/alerts/{id}

    Changes to filtered alerts: /security/alerts/?$filter={parameters}
    For more information, see Security API alerts.
    Teams approvals Changes to all approvals in a tenant: /solutions/approval/approvalItems Maximum subscription quotas:
  • Per tenant (for all applications combined): 1000 total subscriptions across all apps
  • Per app and tenant combination: 1 subscription.
  • Teams callRecord Changes to all call records: /communications/callRecords

    Changes to filtered call records: /communications/callRecords?$filter={parameters}
    For more information, see Change notifications for Call Records.

    Maximum subscription quotas:
  • Per organization: 100 total subscriptions.

    NOTE: Creation of call records also triggers the updated changeType.
  • Teams callRecording All recordings in an organization: communications/onlineMeetings/getAllRecordings

    All recordings for a specific meeting: communications/onlineMeetings/{onlineMeetingId}/recordings

    A call recording that becomes available in a meeting organized by a specific user: users/{id}/onlineMeetings/getAllRecordings

    A call recording that becomes available in a meeting where a particular Teams app is installed: appCatalogs/teamsApps/{id}/installedToOnlineMeetings/getAllRecordings *
    Maximum subscription quotas:
  • Per app and online-meeting combination: 1
  • Per app and user combination: 1
  • Per user (for subscriptions tracking recordings in all onlineMeetings organized by the user): 10 subscriptions.
  • Per organization: 10,000 total subscriptions.
  • Teams callTranscript All transcripts in an organization: communications/onlineMeetings/getAllTranscripts

    All transcripts for a specific meeting: communications/onlineMeetings/{onlineMeetingId}/transcripts

    A call transcript that becomes available in a meeting organized by a specific user: users/{id}/onlineMeetings/getAllTranscripts

    A call transcript that becomes available in a meeting where a particular Teams app is installed: appCatalogs/teamsApps/{id}/installedToOnlineMeetings/getAllTrancripts *
    Maximum subscription quotas:
  • Per app and online-meeting combination: 1
  • Per app and user combination: 1
  • Per user (for subscriptions tracking transcripts in all onlineMeetings organized by the user): 10 subscriptions.
  • Per organization: 10,000 total subscriptions.
  • Teams chat Changes to any chat in the tenant: /chats

    Changes to a specific chat: /chats/{id}

    Changes to a specific chat with the notifyOnUserSpecificProperties query parameter: /chats/{id}?notifyOnUserSpecificProperties={Boolean}

    Changes to all chats in an organization where a particular Teams app is installed: /appCatalogs/teamsApps/{id}/installedToChats

    Changes to all chats that a particular user is part of: /users/{id}/chats

    Changes to all chats that a particular user is part of with the notifyOnUserSpecificProperties query parameter: /users/{id}/chats?notifyOnUserSpecificProperties={Boolean}
    Maximum subscription quotas:
  • Per app and chat combination: 1 subscription.
  • Per organization: 10,000 total subscriptions.
  • Per user (for subscriptions tracking all chats that a particular user is part of): 10 subscriptions.
  • Teams chatMessage Changes to chat messages in all channels in all teams: /teams/getAllMessages

    Changes to chat messages in a specific channel: /teams/{id}/channels/{id}/messages

    Changes to chat messages in all chats: /chats/getAllMessages

    Changes to chat messages in a specific chat: /chats/{id}/messages

    Changes to chat messages in all chats a particular user is part of: /users/{id}/chats/getAllMessages

    Changes to chat messages for all chats in an organization where a particular Teams app is installed: /appCatalogs/teamsApps/{id}/installedToChats/getAllMessages
    Maximum subscription quotas:
  • Per app and channel or chat combination: 1 subscription.
  • Per user (for subscriptions tracking chat messages in all chats the user is part of): 10 subscriptions.
  • Per organization: 10,000 total subscriptions.
  • Teams channel Changes to channels in all teams: /teams/getAllChannels

    Changes to channel in a specific team: /teams/{id}/channels
    Maximum subscription quotas:
  • Per app and team combination: 1 subscription.
  • Per organization: 10,000 total subscriptions.
  • Teams conversationMember Changes to membership in a specific team: /teams/{id}/members

    Changes to membership in all channels under a specific team: teams/{id}/channels/getAllMembers

    Changes to membership in a specific chat: /chats/{id}/members

    Changes to membership for all chats in an organization where a particular Teams app is installed: /appCatalogs/teamsApps/{id}/installedToChats/getAllMembers

    Changes to membership in all chats: /chats/getAllMembers
    Maximum subscription quotas:
  • Per app and team combination: 1 subscription.
  • Per organization: 10,000 total subscriptions.
  • Teams onlineMeeting * Changes to an online meeting: /communications/onlineMeetings(joinWebUrl='{encodedJoinWebUrl}')/meetingCallEvents Doesn't support using $select to return only selected properties. The rich notification consists of all the properties of the changed instance. One subscription allowed per application per online meeting. For more information, see Get change notifications for Microsoft Teams meeting call event updates.
    Teams presence Changes to a single user's presence: /communications/presences/{id}

    Changes to multiple users' presence: /communications/presences?$filter=id in ({id},{id}...)
    The subscription for multiple users' presence is limited to 650 distinct users. Doesn't support using $select to return only selected properties. The rich notification consists of all the properties of the changed instance. One subscription allowed per application per delegated user. For more information, see Get change notifications for presence updates in Microsoft Teams.
    Teams team Changes to any team in the tenant: /teams

    Changes to a specific team: /teams/{id}
    Maximum subscription quotas:
  • Per app and team combination: 1 subscription.
  • Per organization: 10,000 total subscriptions.
  • Teams Shifts offerShiftRequest Changes to any offer shift request in a team: /teams/{id}/schedule/offerShiftRequests Maximum subscription quotas:
  • Per app and resource path combination: 1 subscription per tenant.
  • Per resource path and user combination: 10 delegated user subscriptions per tenant.
  • Teams Shifts openShiftChangeRequest Changes to any open shift request in a team: /teams/{id}/schedule/openShiftChangeRequests Maximum subscription quotas:
  • Per app and resource path combination: 1 subscription per tenant.
  • Per user and resource path combination: 10 subscriptions.
  • Per organization: 10,000 total subscriptions.
  • Teams Shifts shift Changes to any shift in a team: /teams/{id}/schedule/shifts Maximum subscription quotas:
  • Per app and resource path combination: 1 subscription per tenant.
  • Per user and resource path combination: 10 subscriptions.
  • Per organization: 10,000 total subscriptions.
  • Teams Shifts swapShiftsChangeRequest Changes to any swap shift request in a team: /teams/{id}/schedule/swapShiftsChangeRequests Maximum subscription quotas:
  • Per app and resource path combination: 1 subscription per tenant.
  • Per user and resource path combination: 10 subscriptions.
  • Per organization: 10,000 total subscriptions.
  • Teams Shifts timeOffRequest Changes to any time off request in a team: /teams/{id}/schedule/timeOffRequests Maximum subscription quotas:
  • Per app and resource path combination: 1 subscription per tenant.
  • Per user and resource path combination: 10 subscriptions.
  • Per organization: 10,000 total subscriptions.
  • todoTask Changes to all task in a specific task list: /me/todo/lists/{todoTaskListId}/tasks -
    user Changes to all users: /users

    Changes to a specific user: /users/{id}
    Maximum subscription quotas:
  • Per app (for all tenants combined): 50,000 total subscriptions.
  • Per tenant (for all applications combined): 1,000 total subscriptions across all apps
  • Per app and tenant combination: 100 total subscriptions.

    Not supported for personal Microsoft accounts like outlook.com.

    Not supported for Azure AD B2C tenants.

    NOTE: Creation and soft-deletion of users also trigger the updated changeType.
  • Note

    Many resources have limits or quotas on how many subscriptions can be made against that resource. When exceeding that limit, attempts to create a subscription will result in a 403 Forbidden error response. The message property of the error response will explain the limit that has been exceeded.

    Some of these resources support rich notifications (notifications with resource data). For more information about resources that support rich notifications, see Set up change notifications that include resource data.

    Note: Any resource path that begins with /users/{id} can also accept /me to reference the signed-in user.

    Permissions

    In general, subscription operations require read permission to the resource. For example, to get notifications for messages, your app needs the Mail.Read permission. The create subscription article lists permissions needed for each resource type. The following table lists the types of permissions your app can request to use webhooks for specific resource types.

    Permission type Supported resource types
    Delegated - work or school account alert, callRecording, callTranscript, channel, chat, chatMessage (preview), contact, conversation, conversationMember, driveItem, event, group, list, message, offerShiftRequest, openShiftChangeRequest, presence, shift, swapShiftsChangeRequest, team, timeOffRequest, todoTask, user, baseTask (deprecated)
    Delegated - personal Microsoft account contact, driveItem, event, list, message, todoTask, baseTask (deprecated)
    Application alert, callRecord, approvals, callRecording, callTranscript, channel, chat, chatMessage, contact, conversationMember, driveItem, event, group, list, message, offerShiftRequest, onlineMeeting, openShiftChangeRequest, printer, printTaskDefinition, shift, swapShiftsChangeRequest, team, timeOffRequest, user