How to setup webhook for user deactivation?

Atul Pandey 0 Reputation points
2025-02-09T19:12:24.59+00:00

We are building a SaaS platform for onboarding tenants. Their users can log in to our mobile app using SSO.

When the tenant's admin deactivates the user I want to receive a notification so that I can deactivate the user in my app.

I tried setting up a subscription but got this error

'PreconditionFailed': 'StartReceivingChangesOnTenant can not be initiated on a Mega Tenant for service AadGraphNotifications

What is the correct way of doing this?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,108 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Francisco Marrero 76 Reputation points
    2025-02-17T14:04:09.7566667+00:00

    Setting up a webhook to receive notifications for user deactivation involves several steps. Here's a general guide to help you get started:

    1. Create a Webhook Endpoint: You'll need a publicly accessible HTTPS endpoint that can receive HTTP POST requests. This endpoint will be where Microsoft Graph sends the notifications.
    2. Define the Subscription: Use the Microsoft Graph API to create a subscription for the resource you want to monitor. In your case, this would be user deactivation events.

    Handle the Notification: Ensure your endpoint can process the incoming notifications and take appropriate action, such as deactivating the user in your app.


Your answer

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