Use the Microsoft Graph API to get change notifications
Namespace: microsoft.graph
The Microsoft Graph REST API uses a webhook mechanism to deliver change notifications to clients. A client is a web service that configures its own URL to receive notifications. Client apps use notifications to update their state upon changes. For more details, including how to subscribe to and handle incoming notifications, see Set up notifications for changes in user data.
Using the Microsoft Graph API, an app can subscribe to changes on the following resources:
Resource | Supported resource paths | Resource data can be included in notifications |
---|---|---|
Outlook message | Changes to all messages in a user's mailbox: /users/{id}/messages Changes to messages in a user's Inbox: /users/{id}/mailFolders('inbox')/messages |
No |
Outlook event | Changes to all events in a user's mailbox:/users/{id}/events |
No |
Outlook personal contact | Changes to all personal contacts in a user's mailbox:/users/{id}/contacts |
No |
user | Changes to all users:/users Changes to a specific user: /users/{id} |
No |
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 |
No |
Microsoft 365 group conversation | Changes to a group's conversations:groups/{id}/conversations |
No |
driveItem on OneDrive (personal) | Changes to content within the hierarchy of any folder:/users/{id}/drive/root |
No |
driveItem on OneDrive for Business | Changes to content within the hierarchy of the root folder:/drives/{id}/root /users/{id}/drive/root |
No |
list under a SharePoint site | Changes to content within the list: /sites/{id}/lists/{id} |
No |
Security alert | Changes to a specific alert:/security/alerts/{id} Changes to filtered alerts: /security/alerts/?$filter |
No |
Teams callRecord | Changes to all call records: /communications/callRecords |
No |
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 |
Yes |
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, contact, conversation, driveItem, list, event, group, message, user |
Delegated - personal Microsoft account | contact, driveItem, list, event, message |
Application | alert, contact, list, driveItem, event, group, message, user, callRecord, chatMessage |