Share via

Which API permission is required to access Email & Collaboration Alerts from Microsoft Defender for Office 365?

Hai VUONG 25 Reputation points
2025-04-22T13:15:40.5633333+00:00

Hello,

I am currently trying to collect Email & Collaboration Alerts via API, those seen in Microsoft Defender Portal → Email & Collaboration → Alerts view or in Microsoft Purview Portal → Compliance Alerts.

I have already registered an app in Azure AD and granted the following API permissions:

Microsoft Graph

  • SecurityAlert.Read.All (Application permission)

WindowsDefenderATP

  • Alert.Read.All (Application permission)

Admin consent has been granted successfully.

However, when I call: GET https://api.security.microsoft.com/api/alerts

I receive this error:

{ "error": { "code": "Forbidden", "message": "Missing application roles. API required roles: Alert.Read.All,Alert.ReadWrite.All, application roles: ." } }

Even though I already see Alert.Read.All assigned and consented.

Questions:

Are Email & Collaboration Alerts exposed through /api/alerts in the Microsoft 365 Defender API?

If not, is there a separate API or specific permission required to access alerts from:

Microsoft Defender for Office 365?

Microsoft Purview Compliance Portal?

What is the correct combination of:

API resource (e.g., Microsoft Graph, Security, or Purview)?

Permission (Delegated or Application)?

When I tried GET https://graph.microsoft.com/v1.0/security/alerts_v2 I only got alerts from Microsoft Defender for Endpoint, but not from Microsoft Defender For Office36, like in MS Defender or MS Purview portal.

Thank you in advance for your help.

Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author
  1. Vasil Michev 126K Reputation points MVP Volunteer Moderator
    2025-04-22T16:44:31.9166667+00:00

    The alerts_v2 in particular, as you've noted above, will return the Defender for Office 365 alerts. Make sure you have consented to the SecurityAlert.Read.All scope, and are using the correct authentication method (application permissions only work when you authenticate via client secret or certificate, you cannot use them when the app acts on behalf of a user, for example Graph explorer).

    For example this query should return the top Defender for O365 alerts:

    GET https://graph.microsoft.com/v1.0/security/alerts_v2?$filter=serviceSource eq 'microsoftDefenderForOffice365'&$select=id,title,createdDateTime
    

0 additional answers

Sort by: Most helpful

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.