Rene R.
Rene R.

Reputation: 31

Azure Devops REST API delete Release

I´m currently trying to delete a release (not release definition) over the REST API of Azure Devops but can´t find anything on how to do this. Already searched the documentary and googled a lot. Hope someone can give me a clue.

As more details where requested here some more details:

I´m showing a list of releases in my app by getting them from the REST API(here).

In that list I want to create a button to delete an item. I searched the documentary (here) and no result. To delete builds was pretty easy (here), but can´t find anything in the documentary on how to do this with releases.

Upvotes: 3

Views: 1316

Answers (2)

Rene R.
Rene R.

Reputation: 31

After writing the clarification I tryed to use the same request like in build for the release to delete. This is not documented in the Microsoft documentation but seems to work. So here is the request that worked:

DELETE https://{instance}/{organization}/{project}/_apis/release/releases/{releaseId}?api-version=5.1

For {instance} use you server url or the one from Azure Devops.

Upvotes: 0

Hugh Lin
Hugh Lin

Reputation: 19381

For this issue, yes, the delete release rest api is not documented in the official documentation.

I tested the rest api you listed in Postman, but returned 404 Not Found status, release is not deleted:

DELETE https://dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}?api-version=5.1

enter image description here

I tested with the following rest api, and the release can be successfully deleted:

DELETE https://vsrm.dev.azure.com/{org}/{pro}/_apis/release/releases/{releaseId}?api-version=5.1

enter image description here

This api is tracked from the browser's Network by pressing F12:

enter image description here

Hope this helps.

Upvotes: 2

Related Questions