Hey @Akshiya , hope you doing well today.
You're encountering a common issue when automating calendar workflows via the Microsoft Graph API: cancelling too broadly due to insufficient filtering. The Microsoft Graph Calendar API does not inherently cancel "all meetings by participant" unless instructed to do so. It’s likely that the query or event selection logic is overly broad.
I personally wish there was a way to filter /events
by attendee email directly in the Graph query but right now there isn't.
According to the goal: "Cancel only the specific meeting involving both the sender and recipient, not all meetings associated with the sender", we can then filter according to a time window and attendees matching both participants.
The documentation has example code for the time window filter.
After that, search for event(s) where attendees
includes both emails. You can also check if the subject
or other metadata matches any NLP-extracted intent.
Then finally cancel the event.
Example:
DELETE /users/{userId}/events/{eventId}