Is there an example of creating a new release with API

Is there an example of creating a new release with the latest package using the API?

Currently I’m just doing it by calling the octo.exe in my code, but would like to make use of the API

Hi Corey

Thanks for getting in touch.

The API call to create a release is doing a POST to /api/releases with the project id and a package version for each package step.

In practice it would look something like this :

A great way to understand what’s going on is using something like Telerik’s FIddler to see what the UI is doing (it calls the same API) and finding the matching calls inside Octopus.Client, this particular one is a little bit tricky so the code sample should give you a head start.

Let me know how you go



awesome, got it working. thanks.

As far as the package steps, is there a way to designate specific NuGet packages during the Release creation?

Hi Jocooper,

Yep. If you’re using the GUI to create the release there’s a step where you choose latest or a specific version. If you run up Fiddler while creating the release you’ll see what the API call looks like.