How to Change the Primary SharePoint Online Administrator via API
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.

- 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.
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.
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.
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.
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.
Use the 'Send an HTTP request' action in Power Automate, configuring it to target Microsoft Graph with the correct authentication headers and JSON payload.

Seek Specialized Guidance in the Power Platform Community
Since the automation relies on Power Automate, leveraging specialized community resources is the fastest way to obtain exact JSON payloads.
Test the On-Premises REST API Endpoint with Caution
You can explore the legacy /_api/site/owner endpoint, though it may not be fully supported in modern SharePoint Online architectures.
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. Download and Install WPS Office: Visit the official WPS Office website to download the free installer for your operating system.
- 2. Open Your Existing Files: Launch the application and seamlessly open your Microsoft Office documents without any formatting loss or conversion required.

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.




