How to control the scope of access for the Graph API.

Cheng, Leo (CN - AB 成 捷) 20 Reputation points
2025-04-02T03:49:09.0566667+00:00

Dear Everyone,

We currently have an issue regarding accessing user emails through the GRAPH API.
After creating an app and granting the permissions shown in the screenshot, we can retrieve the emails and attachments of specific users via the API. However, we found that we can access the emails of all users within the organization. For security reasons, we would like to restrict access to only the emails of specific users we need. Is there a way to impose such restrictions?

How to restrict access to the GRAPH API so that it can only access the email information of specific users within an organization, not all users.

Thank you very much in advance.

BR
Leo

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
24,215 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andy David - MVP 155.2K Reputation points MVP
    2025-04-02T11:23:26.8966667+00:00

    Yes, follow this doc:

    https://learn.microsoft.com/en-us/exchange/permissions-exo/application-rbac

    Essentially, you are going to create an Exchange Service Principal.(This points to the service principal in Entra)

    Then create the recipient scope. ( This is the mailboxes or groups you want to restrict the service principal access to)

    Then you assign that recipient scope and the allowed roles to the service principal.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Cheng, Leo (CN - AB 成 捷) 20 Reputation points
    2025-04-02T03:53:32.69+00:00

    permissions as below

    Mail.Read Application Read mail in all mailboxes Yes
    Mail.Read Application Read mail in all mailboxes Yes
    Mail.ReadBasic Application Read basic mail in all mailboxes Yes
    Mail.ReadBasic.All Application Read basic mail in all mailboxes Yes
    Mail.ReadWrite Application Read and write mail in all mailboxes Yes
    Mail.Send Application Send mail as any user Yes
    User.Read Delegated Sign in and read user profile No
    0 comments No comments

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.