Child pages
  • REST API Plugin

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Where USERNAME, PASSWORD, "teamcity:8111" should be substituted with real values and data.xml file contains data to send to the server.


Making user a system administrator

1. Enable superuser in REST
create a file <TeamCity Data Directory>\config\ with the content:


(add the line if the file already exists)

2. Get authToken
restart the TeamCity server and look into <TeamCity home>\logs\teamcity-rest.log for a line:

Authentication token for superuser generated: 'XXX-YYY-...-ZZZ'.

Copy this "XXX-YYY-...-ZZZ" string. The string is unique for each server restart

3.Issue the request
Get curl command line tool and use a command line:

curl -v --request PUT http://USER:PASSWORD@teamcity:8111/httpAuth/app/rest/users/username:USERNAME/roles/SYSTEM_ADMIN/g/?authToken=XXX-YYY-...-ZZZ

"USER" and "PASSWORD" - credentials of a valid TeamCity user (that you can login with)
"teamcity:8111" - TeamCity server URL
"USERNAME" - username of the user to make the system administrator
"XXX-YYY-...-ZZZ" - the authentication token retrieved earlier