Bulk updating permissions efficiently?

I am looking for help speeding up the bulk update permissions via the REST API (or Automation).

Specific task details:

  • Setting perms at the Group level, with 1000 Groups.
  • Setting perms for 3 Roles per Group (Member, Manager, and Owner).
  • Includes both setting and unsetting permissions.
  • The current state (on/off) of each permission is not known.

My assumptions:

  • There isn't currently a REST endpoint that will allow me to list permissions set at the Group level.  Eg. I can't get the default Blog permissions for a given Group at the Group level.
  • Making 125 separate REST calls for each Group/Role is very slow, so I developed an HTTP Automation where I can pass all of the 125 permission values in a single REST call to avoid the transmission overhead.

Currently setting the permissions for a single Group/Role combination takes 4.5 minutes.

Is there a way to optimize this?  Am I missing a REST endpoint or even an in-process API that will allow me to do this faster?

The UI can do this very quickly, but the question is if there are public APIs available to do this.

Thanks.