I can see that there are APIs to get users from group
and you can then feed that into remove user from group
But looking to see if it is possible to:
Get users from groupA who have not logged in within the last 30 days and are not in groupB
Then remove those users from groupA