REST API how to add/delete hosts to/from a host group

With the REST API you can create rules in the ruleset “Assignment of hosts to host groups”. There you can assign X hosts to one host group per rule. If you want to delete a host from a group you then would need to edit the rule.