'Is there any ability to rebuild TeamCity build using REST API?

I have successful build in TeamCity, and using TeamCity REST API I know it's id: 104421. But I couldn't find any way to re-build it (using API), like click in 'dependencies' tab a button 'Run build with the same revisions...'. Is there any ability? Thanks.

enter image description here



Solution 1:[1]

There can be different levels as to what exactly you mean by rebuilding: you might want to run a new build with the same revisions, dependencies, custom parameters, use the same agent...

REST API approach to the task is to get the existing build details via URL like .../app/rest/builds/id:NNN

then modify the retrieved data if necessary and POST it back to the URL .../app/rest/buildQueue

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yaegor