You would have to do a Device edit, the steps would be:
1. Enter group you want to delete
2. Get(group) where name : DesiredGroup -> This gets you the group object which includes the ID which you will need
2. Get(Device) where group : DesiredGroup
3. Loop through the results and remove that specific group based on the group id
4. Create a multicall of Set(Device) for each device extracted in step 2, using the edited objects
5. Run the multicall
6. You're done.