I managed to use Power Automate to create SP groups and add users to them using the HTTP request action.
The problem I have is the newly created groups are created at the "root" (in People and Groups section) level but not in the site in the "Site Permissions" section so user that i add to the group still do not have access to the site.
I created a flow that adds the group(s) to "site Pages" , "Site assets" and to the specific libraries but they don't have access to the site itself since the groups are not in "Site Permissions".
Does anyone know how to add a newly created group to "Site Permissions"?