TeamCity REST API Reference 2023.05 Help

Manage Version Control Settings

TeamCity allows you to store project settings as configuration files kept inside VCS repositories. These settings can be stored in the simple XML format, or using the Kotlin programming language.

In TeamCity UI, version control settings can be accessed on the Administration | Project Settings | Versioned Settings page. This article explains how to read and modify the same settings via REST API.

All endpoints related to versioned settings start with /app/rest/projects/project_locator/versionedSettings/....

View and Edit Common Configuration Settings

The current versioned settings configuration can be viewed and edited via the ...config endpoint.

  • View configuration

  • View the current value of the specific configuration setting.

    /app/rest/projects/{locator}/versionedSettings/config/parameters/{name} # Example /app/rest/projects/DotNetSamples/versionedSettings/config/parameters/allowUIEditing
  • Edit the specific configuration setting. The new value is passed in the text/plain format in the request body.

    /app/rest/projects/{locator}/versionedSettings/config/parameters/{name} # Example # Request body: "false" /app/rest/projects/DotNetSamples/versionedSettings/config/parameters/allowUIEditing
  • Modify the entire configuration. The request body must contain payload according to the VersionedSettingsConfig schema.

    /app/rest/projects/{locator}/versionedSettings/config # Example # Request body (JSON): {"allowUIEditing":"true","buildSettingsMode":"alwaysUseCurrent", # "format":"xml","showSettingsChanges":"false","storeSecureValuesOutsideVcs":"true", # "syncronizationMode":"enabled", # "vcsRootId":"DotNetSamples_HttpsGithubComValravnTeamcityDotnetSamples2refsHeadsMaster"} /app/rest/projects/DotNetSamples/versionedSettings/config

Synchronize Settings

  • Emulate a click on the Versioned Settings | Change Log | Check for changes button. Schedules the TeamCity task to check for pending changes.

  • Commit current project settings to the related VCS.

  • Load settings from the related VCS and override current project settings. In case of success, the response returns the list of all synchronized projects.


Other Tasks

  • View all subprojects whose versioned settings are inherited from the current project.

  • Obtain the list of context parameters. To modify an existing parameter, send the POST request with the VersionedSettingsContextParameters body.

  • Return the message displayed on the Versioned Settings | Configuration page. This message conveys the result of the most recent settings update.

  • Return the list of tokens. You can send POST and DELETE requests to this endpoint to create new and remove existing tokens. Note that you can only remove currently unused tokens.

Last modified: 24 May 2023