Note: Microsoft is providing this information as a convenience to you. These sites are not controlled by Microsoft, and Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please ensure that you fully understand the risks before using any suggestions from the below link.
Thank you for posting your question in the Microsoft Q&A forum.
Microsoft Graph is a RESTful web API that enables you to access Microsoft Cloud service resources.
Which means Microsoft Graph does not communicate to SharePoint Server (on‑prem) directly.To restrict a user from using the SharePoint On-Premises REST API, you cannot block the REST API directly (it uses the same permissions as normal SharePoint access). Instead, you must control access by adjusting permissions or limiting endpoints.
- Like you mentioned, you can break inheritance or remove Permissions on the Site / List / Library If a user has: No access to a site → REST cannot read it, Read-only access to a list → REST can only read. To do that, go to Site Settings > Site Permissions > Remove user/group or change them to read-only. If needed, break inheritance on specific lists/libraries and remove permissions there
- Create a custom permission level without “Use Remote Interfaces” permission. This permission allows REST/SOAP/Client Object Model calls. access - Permissions check box "Use Remote Interfaces" when unchecked prevents users from…
- If you want to block it fully, in IIS: Select the SharePoint web application > Go to Request Filtering Block URLs containing: _api/ _vti_bin/client.svc or use IP Restrictions to block users from certain IP ranges. Please note it will affect all users.
Please try and let me know if it works for you.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.