Azure AD Calendar API 401 Unauthorized Error - Need Help

Anthony Pitra 0 Reputation points
2025-10-01T16:35:19.1966667+00:00

Problem Description

I'm getting a 401 Unauthorized error when trying to create calendar events using Microsoft Graph API with Azure AD authentication. The error occurs specifically when calling the /me/events endpoint to create calendar events.
When calling /me is working well.

Current Setup

Error Details

  • Status Code: 401 Unauthorized
  • Error: GraphError from @microsoft/microsoft-graph-client
  • Endpoint: /me/events (POST request)
  • Authentication: Azure AD OAuth2 with delegated permissions

Current Setup

What Works

  • User authentication succeeds
  • Can retrieve user profile (/me endpoint works)
  • Token is valid and not expired
  • Scopes include Calendars.ReadWrite

What Fails

  • Creating calendar events (/me/events POST) returns 401
  • Error body shows empty message
  • Status code: 401 Unauthorized
Microsoft Security | Microsoft Entra | Microsoft Entra ID

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.