TeamCity 2020.2 Help

Manage Projects

This article lists REST API requests concerning projects.

Projects and Build Configuration/Templates Lists

List of projects
GET http://<TeamCity Server host>:<port>/app/rest/projects
Project details
GET http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>

where <projectLocator> can be id:<internal_project_id> or name:<project%20name>

List of build configurations
GET http://<TeamCity Server host>:<port>/app/rest/buildTypes
List of build configurations of a project
GET http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/buildTypes

Get projects with subprojects' build configurations data and their order as configured by the specified user on the Overview page

GET http://<TeamCity Server host>:<port>/app/rest/projects?locator=selectedByUser:current&fields=count,project(id,parentProjectId,projects(count,project(id),$locator(selectedByUser:current)),buildTypes(count,buildType(id),$locator(selectedByUser:current)))
List of templates for a particular project
GET http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/templates
List of all the templates on the server
GET http://<TeamCity Server host>:<port>/app/rest/buildTypes?locator=templateFlag:true

Project Settings

Get project details

GET http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>

Delete a project

DELETE http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>

Create a new empty project

POST plain text (name) to http://<TeamCity Server host>:<port>/app/rest/projects/

Create (or copy) a project

POST XML <newProjectDescription name='New Project Name' id='newProjectId' copyAllAssociatedSettings='true'><parentProject locator='id:project1'/><sourceProject locator='id:project2'/></newProjectDescription>

to

http://<TeamCity Server host>:<port>/app/rest/projects

Also see an example.

Edit project parameters

GET/DELETE/PUT http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/parameters/<parameter_name>

Accepts plain text and XML and JSON. Produces XML, JSON, and plain text depending on the "Accept" header.

Also supported requests: .../parameters/<parameter_name>/name and .../parameters/<parameter_name>/value.

Project name/description/archived status

GET/PUT http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/<field_name>

where <field_name> is one of name, description, archived.

Accepts/produces text/plain.

Project's parent project

GET/PUT XML http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/parentProject

Project Features

Project features (for example, issue trackers, versioned settings, custom charts, shared resources and third-party report tabs) are exposed as entries under the "project" node and via dedicated requests.

List of project features

http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/projectFeatures

To filter features, add ?locator=<projectFeaturesLocator> to the URL, for example to find all issue tracker features of GitHub type, use the locator type:IssueTracker,property(name:type,value:GithubIssues).

Create a feature

POST to /projects/<projectLocator>/projectFeatures.

Edit features

GET/DELETE/PUT http://<TeamCity Server host>:<port>/app/rest/projects/<projectLocator>/projectFeatures/<featureId>
Last modified: 25 January 2021