API that registers several hosts

I need to register several hosts, their IP’s, groups and templates through the icinga2 API.
I wanted to know if you have a way to delete multiple hosts, groups and templates by API at once
Thank you

Querying objects
Deleting objects

Feel free to ask further questions if you get stuck on specifics.

I suggest starting with querying objects, playing around with filters and checking if the correct objects are returned