How to Find SharePoint Site Visibility Using Microsoft Graph API
Question details
The user needs to find a way to check if a SharePoint site is public or private using the Microsoft Graph API, as the direct site response lacks a visibility property.

- Product
- Microsoft Graph API
- Device & OS
- not provided
- Scenario
- Developing a Microsoft Graph integration that requires identifying SharePoint site visibility.
- Observed behavior
- The standard Microsoft Graph API site response does not expose a direct 'visibility' property to indicate whether the site is public or private.
Ensure you have the necessary API permissions configured in Microsoft Entra ID (formerly Azure AD), such as Sites.Read.All or Group.Read.All, and an active Microsoft Graph access token before querying SharePoint properties.
Check the Connected Microsoft 365 Group Visibility
If the SharePoint site is team-connected, its visibility is determined by the associated Microsoft 365 Group rather than the site itself.
In Microsoft 365 architecture, team sites are usually backed by a Microsoft 365 Group. The Microsoft Graph API separates site data from group data. Because of this, the site endpoint itself does not have a 'visibility' property. Instead, you must identify the associated group and query its properties.
Make a GET request to 'https://graph.microsoft.com/v1.0/sites/{site-id}' to retrieve the site details.
Look for the 'group' relationship object within the returned JSON response and extract the group ID.
Make a subsequent GET request to 'https://graph.microsoft.com/v1.0/groups/{group-id}' using the ID obtained in the previous step.
In the group response, check the 'visibility' property. It will return either 'Public' or 'Private', which corresponds to the SharePoint site's visibility.

Consult the Microsoft Q&A Developer Community
For complex API queries involving standalone communication sites or specific tenant configurations, seeking advice from Microsoft engineers is recommended.
Looking for a reliable Office suite? Try WPS Office
While Microsoft Graph and SharePoint handle complex enterprise APIs, your daily document creation and editing needs might just require a lightweight, fast, and highly compatible office suite. WPS Office provides an excellent free alternative to Microsoft Office, offering full compatibility with Word, Excel, and PowerPoint formats without the heavy resource usage.
- 1. Download the Installer: Visit the official WPS Office website and download the free installer for your operating system.
- 2. Install WPS Office: Run the setup file and follow the on-screen instructions to complete the fast installation process.
- 3. Open Your Documents: Launch WPS Office and instantly open your existing Microsoft Word, Excel, or PowerPoint files with perfect formatting.

Frequently Asked Questions
Why doesn't the Microsoft Graph site endpoint return a visibility property?
Microsoft Graph API separates site architecture from Microsoft 365 Group architecture. A team site's public or private status is inherently tied to its connected Microsoft 365 Group, so the API requires you to query the group endpoint to find the 'visibility' attribute.
How do I find the group ID for a SharePoint site via Graph API?
You can retrieve the group ID by calling the site endpoint (GET https://graph.microsoft.com/v1.0/sites/{site-id}) and checking for the 'group' object within the JSON response. The group ID will be nested within that object.
Does WPS Office offer a way to manage SharePoint files directly?
WPS Office is a powerful client-side document editor. While it does not natively manage SharePoint site permissions or API settings, you can seamlessly open, edit, and save documents hosted on SharePoint if they are synced to your local device via Microsoft OneDrive.




