Hi everyone,
I’m looking for some guidance on creating M365 SharePoint sites via the graphAPI.
At the moment, I don’t have access to a test environment, so it’s difficult for me to describe my exact technical requirements or try things out myself. What I’d like to understand is
Once I have access to a test environment, I’ll be able to define my use case and technical details more precisely. For now, I’m mainly trying to get an overview of what’s possible and what the usual approach looks like.
I know this might be a bit off topic post, but any pointers or examples would be greatly appreciated.
Hello.
I haven't done anything between OutSystems and SharePoint in almost 8 years, but it was quite easy back then. I just followed Sharepoint's API documentation.
Don't forget to look in the Forge for SharePoint components and Graph connector.
https://www.outsystems.com/forge/list?q=sharepoint
Thanks for the link, will be sure to go through these
Permissions & App Registration
Register an app in Azure AD (Microsoft Entra ID)
Use Application permissions (for backend automation):
Sites.ReadWrite.All (required)
Group.ReadWrite.All (needed for Team sites via M365 Groups)
Grant Admin Consent
Use Client Credentials flow (no user login needed)
Create SharePoint Site (Graph API)
Team Site (M365 Group-backed):
POST https://graph.microsoft.com/v1.0/groups
Body:
{
"displayName": "My Team Site",
"mailNickname": "myteamsite",
"mailEnabled": true,
"securityEnabled": false,
"groupTypes": ["Unified"]
}
Communication Site (via SharePoint API, not pure Graph):
POST https://{tenant}-admin.sharepoint.com/_api/SPSiteManager/create
Best Practices
Prefer Group-based (Team sites) for collaboration scenarios
Use naming conventions for governance (important in enterprise apps)
Handle throttling (429 errors) with retry logic
Store Site IDs after creation for later API calls
Use templates carefully (Graph has limited template control)
OutSystems Integration Tips
Use REST API method with OAuth2 (Client Credentials)
Store token in a site property or use a reusable action
Check Forge components:
Microsoft Graph connectors
SharePoint connectors
Important Notes
Graph API for SharePoint is still partially limited (especially for advanced provisioning)
Some operations still require SharePoint REST API
Always test in a dev tenant (Microsoft 365 Developer Program) before production
This is the standard modern approach used in most enterprise integrations.
Thanks for the detailed reply!