How to Restrict Microsoft Graph API Chat Access to Only Chats Involving a Specific User (User1)?

Riddhi Patel 30 Reputation points
2025-07-11T13:03:36.3+00:00

Hi Community,

I’m working on a Teams integration using the Microsoft Graph API at the service principal (app-only) level. I’m using the following endpoint to read chat messages:

GET https://graph.microsoft.com/v1.0/chats/{chat-id}/messages

My Goal:

I want to restrict access so that the app can only read messages from chats involving a specific user (User1). For example:

  • Chats between User1 and User2
  • Chats between User1 and User3
  • But not chats between User2 and User3

Current Concern:

Using Chat.Read.All gives access to all chats in the tenant, which I want to avoid due to security and privacy concerns.

My Questions:

Is there a way to restrict Graph API access to only chats where User1 is a participant?

Can this be achieved using Resource-Specific Consent (RSC) permissions?

Is there any better approach or best practice to meet this requirement securely?

Any help, documentation references, or examples would be much appreciated.

Thanks in advance!

Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
0 comments No comments
{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.