Configure host to be an Icinga Agent

My Icinga setup is running with master and multiple satellites.
Director is up and running fine for months.

Now I would like to add new hosts via the director api.
Creating a host is no problem but I need the agent as well.

If I try to get a token it does not work. The manual says:
“Please expect an error in case the host does not exist or has not been configured to be an Icinga Agent.”

Is it possible to do that via director api or have I use the Icinga api for that?