Cannot Configure Octopus Roles via REST API Or create new Environment in Octopus using REST API


We are currently on version “3.2.15”. Using REST API I can call Get method and receive all the information in our environment as well as computers. What I seem to do is send a POST request even simple creating new Environment. Below is the issue I get trying to create new environment as well trying to configure machine role.

Invoke-RestMethod : The remote server returned an error: (404) Not Found.

If someone could help with this, it would be great.


Thanks for reaching out. There’s an open source project called Octoposh that provides a few powershell cmdlets that interact with the Octopus API. You can do both things using it:

Create an environment:

Add/remove roles from machines:

If you are not using Powershell and you’d rather have the RAW API calls, let me know and we’ll give you a hand with it.