Share via

Filter Microsoft Graph Webhook Subscription by Email Subject Prefix

Surekha Yeddula 60 Reputation points
2026-02-16T07:17:39.8266667+00:00

I am working with Microsoft Graph webhooks for Outlook mail and would like to know if it’s possible to filter notifications at the subscription level based on the email subject.

Requirement I only want my system to receive webhook notifications for emails where the subject starts with:

"Quote of the Day" 

At the moment, the subscription notifies my endpoint for all incoming emails, and I then have to filter them after receiving the notification. I would like to avoid this extra processing if possible.

Question

Is there a way to apply a subject-based filter directly in the subscription resource (for example using $filter) so that only matching emails trigger notifications?

Example

Current subscription request (simplified):

POST https://graph.microsoft.com/v1.0/subscriptions
{
  "changeType": "created",
  "notificationUrl": "https://myapp.com/notifications",
  "resource": "me/mailFolders('Inbox')/messages",
  "expirationDateTime": "2026-02-17T10:00:00Z",
  "clientState": "secretValue"
}

What I’m looking for is something conceptually like this (if supported):

"resource": "me/mailFolders('Inbox')/messages?$filter=startswith(subject,'
Quote of the Day
')"

Clarification Needed

Does Microsoft Graph support subject-based filtering in webhook subscriptions?

If not, is server-side filtering the only supported approach after receiving notifications?

Are there any recommended patterns or workarounds for this scenario?

Any guidance or official documentation references would be greatly appreciated.

Microsoft 365 and Office | Development | Other
0 comments No comments
{count} votes

Answer accepted by question author
  1. Q&A Assist
    2026-02-16T07:17:49.68+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Microsoft Graph does not currently support filtering notifications at the subscription level based on the email subject. The $filter query parameter can be used to refine notifications, but it does not allow for filtering based on the subject of incoming emails in the way you described. Therefore, you will need to handle filtering on the server-side after receiving the notifications for all incoming emails.

    This means that your current approach of subscribing to all messages and then filtering them based on the subject after receiving the notifications is the only supported method for this scenario.

    For more information on how to set up notifications and the limitations of subscriptions, you can refer to the Microsoft Graph documentation on change notifications.


    References:

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Vasil Michev 125.2K Reputation points MVP Volunteer Moderator
    2026-02-16T07:43:35.8933333+00:00

    You cannot. While some of the resources that are supported for subscriptions/notifications do support the $filter parameter, the messages resource does not. You will have to do the filtering client-side.

    1 person found this answer helpful.
    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.