TeamCity REST API Reference 2022.10 Help

Manage VCS Roots

This article lists REST API requests concerning VCS roots.

List VCS Roots

To get all VCS roots, use:


Endpoint responds with VcsRoots entity which contains instances of VcsRoot.

To get specific root(s), use:


The vcsRootLocator is typed as a VcsRootLocator entity. For example, to get a VCS root with ID MyCustomRoot use:


To get all Git-based VCS roots, use:


Create VCS Root

To create a new VCS root, POST a VcsRoot entity to:


Example payload:

<vcs-root id="MyCustomRoot" name="MyCustomRoot" vcsName="jetbrains.git"> <project id="MyCustomProject"/> <properties count="3"> <property name="authMethod" value="ANONYMOUS"/> <property name="branch" value="refs/heads/master"/> <property name="url" value=""/> </properties> </vcs-root>
{ "id": "MyCustomRoot", "name": "MyCustomRoot", "vcsName": "jetbrains.git", "project": { "id": "MyCustomProject" }, "properties": { "property": [ { "name": "authMethod", "value": "ANONYMOUS" }, { "name": "branch", "value": "refs/heads/master" }, { "name": "url", "value": "" } ] } }

Delete VCS Root

To delete a VCS root, use:


Update VCS Root Definition

You can retrieve a certain VCS root property via:


and update it with the PUT request using text/plain body:


Similarly, you can use GET/PUT to receive and update field values (id, name, or project — the latter accepts ProjectLocator for associating a VCS root with a specific project):


List VCS Root Instances

To get VCS root instances, use:


vcsRootInstanceLocator is typed as VcsRootInstanceLocator. For example, to get all instances of a VCS root with the MyVCSRoot ID use:


Post Commit Hook Notification

To notify TeamCity about a new commit from the commit hook context, use:


It schedules checking for changes for the matched VCS root instances and returns a plain-text human-readable message on the action performed; HTTP response 202 in case of successful operation.

Last modified: 26 October 2022