...
If you perform a request from within a TeamCity build, for a limited set of build-related operations (like downloading artifacts) you can use values of teamcity.auth.userId/teamcity.auth.password
system properties as credentials (within TeamCity settings you can reference them as %system.teamcity.auth.userId%
and %system.teamcity.auth.password%
).
The server URl is available as %teamcity.serverUrl%
within a build.Within a build, a request for current build details can look like:
curl -u "%system.teamcity.auth.userId%:%system.teamcity.auth.password%" "%teamcity.serverUrl%/httpAuth/app/rest/builds/id:%teamcity.build.id%"
Superuser access
You can use the super user account with REST API: just provide no user name and the generated password logged into the server log.
...