TeamCity REST API Reference 2024.07 Help

Create and Delete Projects

This article shows how to create, archive, and remove projects via TeamCity REST API.

Create Project

To create a project, compose and post a NewProjectDescription entity to:

/app/rest/projects

Specify name, id, and parentProject via its locator string (to define a project under the Root project, use id:_Root).

Example payload:

<newProjectDescription copyAllAssociatedSettings="true" id="string" name="string"> <parentProject locator="string" /> </newProjectDescription>
{ "parentProject": { "locator": "locator" }, "name": "name", "id": "id", "copyAllAssociatedSettings": true }

Copy Project

To make a copy of an existing project, add the sourceProject locator to define the source project.

Example payload:

<newProjectDescription copyAllAssociatedSettings="true" id="string" name="string"> <sourceProject locator="string" /> <parentProject locator="string" /> </newProjectDescription>
{ "parentProject": { "locator": "locator" }, "name": "name", "id": "id", "copyAllAssociatedSettings": true, "sourceProject": { "locator": "locator" } }

Archive Project

To get a project's archived status, use:

/app/rest/projects/<projectLocator>/archived

To update its status, use:

/app/rest/projects/<projectLocator>/archived

The payload should be either true or false.

Delete Project

To delete a project, use:

/app/rest/projects/<projectLocator>

The projectLocator parameter is a locator string typed as ProjectLocator. For example, to delete a project with the ID MyCustomProject, use:

/app/rest/projects/id:MyCustomProject
Last modified: 27 December 2022