TeamCity 2021.1 Help

Manage Users

This article lists REST API requests concerning users and user groups.

Users

List of users

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

Get specific user details

GET http://<TeamCity Server host>:<port>/app/rest/users/<userLocator>

Create a user

POST http://<TeamCity Server host>:<port>/app/rest/users

Update/remove specific user

PUT/DELETE http://<TeamCity Server host>:<port>/app/rest/users/<userLocator>

For the POST and PUT requests for a user, post data in the form retrieved by the corresponding GET request. Only the following attributes/elements are supported: name, username, email, password, roles, groups, properties.

Work with user roles

GET http://<TeamCity Server host>:<port>/app/rest/users/<userLocator>/roles

<userLocator> can be of a form:

  • id:<internal user id> — to reference the user by internal ID

  • username:<user's username> — to reference the user by username/login name

User's single field

GET/PUT http://<TeamCity Server host>:<port>/app/rest/users/<userLocator>/<field_name>

User's single property

GET/DELETE/PUT http://<TeamCity Server host>:<port>/app/rest/users/<userLocator>/properties/<property_name>

User Groups

List of groups

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

List of users within a group

GET http://<TeamCity Server host>:<port>/app/rest/userGroups/key:Group_Key

Create a group

POST http://<TeamCity Server host>:<port>/app/rest/userGroups

Delete a group

DELETE http://<TeamCity Server host>:<port>/app/rest/userGroups/key:Group_Key

User Access Tokens

List of access tokens

GET http://<TeamCity Server host>:<port>/app/rest/users/<userLocator>/tokens

Create an access token

POST http://<TeamCity Server host>:<port>/app/rest/users/<userLocator>/tokens/<tokenName>

Delete an access token

DELETE http://<TeamCity Server host>:<port>/app/rest/users/<userLocator>/tokens/<tokenName>
Last modified: 20 February 2021