How to specify Deployment targets from REST API

How can I call the Octopus deployment API to deploy to a list of target hosts as described here?

Hi Steven,

Thanks for getting in touch! Creating a release and deployment directly from the REST API is not something we can recommend doing here. We have built a command line tool on top of our API in order to help operate Octopus from the command line. This tool is Octo.exe.

Octo.exe has a deploy-release option which you can add flags to in order to create a deployment from the command line. One of the flags is:

      --specificmachines=VALUE
                             [Optional] A comma-separated list of machines
                             names to target in the deployed environment. If
                             not specified all machines in the environment
                             will be considered.

Let me know if this helps you here, or if you have further questions.

Best regards,
Daniel