logo
search
Others

How to Change the Primary SharePoint Online Administrator via API

Aamir Naveed AkramAamir Naveed Akram Oct 21, 2026 870 views

Question details

The user needs to set a specific user as the primary site collection administrator or owner in SharePoint Online using an API endpoint.

How to Change the Primary SharePoint Online Administrator via API
Product
SharePoint Online
Device & OS
not provided
Scenario
Automating the assignment of a primary site collection administrator using an API within a Power Automate workflow.
Observed behavior
Setting the IsSiteAdmin property to true only adds the user as a secondary administrator. The exact endpoint and request body required to assign a user as the primary owner remain unclear.
Before you start

Ensure you have Global Administrator or SharePoint Administrator rights in your tenant, and that your API application has been granted the necessary Microsoft Graph or SharePoint administrative permissions.

Solution 1Recommended

Use Microsoft Graph API for Administrator Management

Microsoft Graph is the modern, recommended standard for managing Microsoft 365 groups and SharePoint Online site administration permissions.

Since legacy REST endpoints often behave differently in modern SharePoint Online environments, Microsoft Graph provides dedicated endpoints for modifying Group owners and Site administrators.

1
Identify the target site or group

Determine whether the SharePoint site is group-connected (Microsoft 365 Group) or a standalone communication/team site. This dictates which Graph endpoint you must call.

2
Construct the Microsoft Graph HTTP request

Use the Microsoft Graph API endpoint for Groups (e.g., POST /groups/{id}/owners/$ref) to add a user as an owner. The request body must contain the user's directory object URI.

3
Execute the request in Power Automate

Use the 'Send an HTTP request' action in Power Automate, configuring it to target Microsoft Graph with the correct authentication headers and JSON payload.

Use Microsoft Graph API for Administrator Management
API Documentation: Always consult the latest Microsoft Graph API documentation, as endpoints and supported methods for site management are frequently updated.
Free Microsoft Office alternative

Looking for a Lightweight Document Solution? Try WPS Office

While you manage complex SharePoint permissions and API integrations, you might also need a reliable desktop suite for handling your daily documents. WPS Office is a free, lightweight, and highly compatible alternative to Microsoft Office, perfect for creating, editing, and collaborating on files with ease.

  1. 1. Download and Install WPS Office: Visit the official WPS Office website to download the free installer for your operating system.
  2. 2. Open Your Existing Files: Launch the application and seamlessly open your Microsoft Office documents without any formatting loss or conversion required.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx)Lightweight application with extremely fast installation and startup timesFree to use with an intuitive, familiar user interface that requires no learning curveBuilt-in PDF editing, conversion, and annotation tools integrated directly into the suite
microsoft office alternative - wps office

Frequently Asked Questions

Does setting the IsSiteAdmin property make someone a primary administrator?

No. Setting IsSiteAdmin to true typically adds the user to the Site Collection Administrators group as an additional (secondary) administrator, rather than replacing or setting them as the singular primary owner.

Can I reliably use the /_api/site/owner REST endpoint in SharePoint Online?

While this endpoint was standard for on-premises SharePoint, its functionality in modern SharePoint Online is often limited or unsupported. Microsoft Graph is the recommended modern alternative for managing ownership.

Where can I find specific JSON payloads for Power Automate HTTP actions?

The best resources for up-to-date, tested JSON payloads and HTTP action configurations are the official Microsoft Power Platform Community forums and Microsoft Q&A.