An API that connects multiple Microsoft services, enabling data access and automation across platforms
Hi,
I'm not aware of an option in POST /groups that automatically grants an application Sites.Selected access to the group's SharePoint site.
I'd handle this as part of the provisioning process:
- Create the Microsoft 365 group.
- Retrieve its SharePoint site using GET /groups/{id}/sites/root.
- Grant the application access using POST /sites/{site-id}/permissions.
The SharePoint site may not be ready immediately, so allow for retries with a timeout. Respect the Retry-After header if Microsoft Graph throttles the requests.
Creating the site permission requires Sites.FullControl.All. An application with only Sites.Selected cannot grant itself access to a new site.
You could use a separate, tightly controlled provisioning identity to perform the grants, while keeping your main application on Sites.Selected.
Microsoft references: