Registering an agent based host via Rest API

you need to generate a ticket:

here it is done by the icinga2 api (5665)

but there is also a selfservice api endpoint for the ticket:
/icingaweb2/director/self-service/register-host returns the HOSTKEY if successfully registered

you can use this key to ask icinga director selfservice api for the ticket

https://youricinga/icingaweb2/director/self-service/ticket?key=HOSTKEY

and the ticket can be used in the node wizard