logo
search
Others

How to Find SharePoint Site Visibility Using Microsoft Graph API

Amos GikundaAmos Gikunda Oct 8, 2026 868 views

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.

How to Find SharePoint Site Visibility With Microsoft Graph API
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.
Before you start

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.

Solution 1Recommended

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.

1
Query the SharePoint Site

Make a GET request to 'https://graph.microsoft.com/v1.0/sites/{site-id}' to retrieve the site details.

2
Extract the Group ID

Look for the 'group' relationship object within the returned JSON response and extract the group ID.

3
Query the Group Endpoint

Make a subsequent GET request to 'https://graph.microsoft.com/v1.0/groups/{group-id}' using the ID obtained in the previous step.

4
Check the Visibility Property

In the group response, check the 'visibility' property. It will return either 'Public' or 'Private', which corresponds to the SharePoint site's visibility.

Check the Connected Microsoft 365 Group Visibility
Standalone Sites: For standalone communication sites without an associated Microsoft 365 group, visibility is managed through direct site permissions and cannot be checked via a single group property.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS Office website and download the free installer for your operating system.
  2. 2. Install WPS Office: Run the setup file and follow the on-screen instructions to complete the fast installation process.
  3. 3. Open Your Documents: Launch WPS Office and instantly open your existing Microsoft Word, Excel, or PowerPoint files with perfect formatting.
Fully compatible with Microsoft Office formats (.docx, .xlsx, .pptx)Free, lightweight, and fast installation on all major platformsFamiliar user interface requiring no learning curveBuilt-in PDF editing and AI tools for writing and data analysisSeamless cloud integration for easy document backup and collaboration
microsoft office alternative - wps office

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.