TeamCity REST API Reference 2024.03 Help

Manage Users

This article lists REST API requests concerning users.

Get Users

To get a list of all users, send:


The endpoint responds with a Users entity which contains instances of a User entity.

Get Specific User Details


Here, userLocator is typed as UserLocator. For example, to get a user by username, send:


Get Current User

To get the entity of the currently authenticated user, send:


Here, current is a dimension of UserLocator.

Create User

To create a user, POST a User entity to:


Example payload:

<user email="string" name="string" username="string" password="string"> <roles> <role roleId="SYSTEM_ADMIN" scope="g"/> </roles> <groups> <group key="MyCustomGroupKey"/> </groups> </user>
{ "username": "username", "password": "password", "email": "email", "roles": { "role": [ { "roleId": "SYSTEM_ADMIN", "scope": "g", } ] }, "groups": { "group": [ { "key": "MyCustomGroupKey" } ] } }

Update/Remove Specific User

To update a user definition, PUT an updated User entity to:


To delete a user, use:


Handle Groups

To retrieve groups for a specific user, run the following request:


To update the group ownership, send an updated Groups entity to:


Example payload:

<groups> <group key="MyCustomGroupKey"/> </groups>
{ "group": [ { "key": "MyCustomGroupKey" } ] }

To delete user from a given group, use:


Here, groupLocator is typed as UserGroupLocator.

Manage User Roles

To get user roles for a specific user, run the following request:


Similarly to updating the user entity, you can update them all by sending a PUT request:


Example payload:

<roles> <role roleId="SYSTEM_ADMIN" scope="g"/> </roles>
{ "role": [ { "roleId": "SYSTEM_ADMIN", "scope": "g", } ] }

Alternatively, you can add a new role by this PUT request:


or delete an existing role:


Manage Access Tokens

User can create tokens only for own account, regardless of their level of permissions. To get a list of owned tokens, send:


To create a new access token, send:


To delete an access token, send:

Last modified: 27 March 2024