DownUnderPostie I did, but I had to resort to analyzing the HTTP requests when using the UI so that I could replicate the requests. I found no documentation on this at the moment. It seems Microsoft also uses the Graph API to carry out the policy creations, so it wasn't too difficult finding the values that needed to be substituted, although the overall template that is needed is quite unreadable (for me).
Overall there were two important requests - One to create the local user group policy (https://graph.microsoft.com/beta/deviceManagement/configurationPolicies) and one to add groups/devices to the policy (https://graph.microsoft.com/beta/deviceManagement/configurationPolicies('$id')/assign).
The templates I extracted are too long to post here, so if you have difficulty extracting them yourself let me know and I will find a way to get them to you