REST API to add host to inventory for Ansible Tower is Not working!

Hi,
   I have been trying to execute a REST API to
Add a host to an inventory.Below is the API.

/api/v2/inventories/{id}/hosts/

Unfortunately, This API doesn't work. It gives the response as 200(Ok). But only displays the existing host. Its the same response when you run GET method for the same API call. Can someone please help me rectifying the error.

Thanks,
Vivek

Hello Vivek,

this list is for Ansible only, not for Tower or AWX.

Please contact Redhat support.

Regards
         Racke

Hi Vivek

As Stefan mentioned this list is not for AWX/Tower queries, BUT please take a look at either the tower-cli or awx-cli depending on your version and also the tower specific modules for doing such tasks. For instance, https://docs.ansible.com/ansible/latest/modules/tower_host_module.html#tower-host-module

Regards
Phil.