I am getting Unauthorised error without reason while subscribing to email notification using graph API

Yamin Lawar 0 Reputation points
2025-04-15T16:17:03.6533333+00:00

We're developing an application that needs to read clients' Outlook emails for internal use. We've created an application in Azure AD and configured all required permissions to fetch emails and receive notifications.

Our implementation uses client credentials flow (not OAuth), passing secrets, tokens, tenantId, and clientId to call the Graph API. We successfully tested this with our personal Azure accounts - we're able to receive notifications when emails arrive in the subscribed inbox and also fetch emails.

However, after migrating to our enterprise Azure account for company use, the same code is failing with authorization errors specifically when calling the create subscription API though I am able to fetch all the users in my enterprise app with the same token but could not create subscriptions for them.

Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,834 questions
{count} votes

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.