TeamCity REST API Reference 2025.11 Help

User

A TeamCity user account.

Related Help article: User Account

Properties

username

The mandatory username.

name

The public user name, or null if not specified.

id

The unique user account ID.

email

lastLogin

The date and time when this user last logged in TeamCity.

password

The user password. For security reasons, TeamCity does not return the value of this field via GET requests. You can only use PUT requests to set new password values.

hasPassword

Returns true if the user has a regular password; otherwise, false. Users with no password cannot log in using the username/password credentials pair.

realm

This member supports the internal infrastructure and is not intended to be used directly from your code.

href

The relative (without the TeamCity server URL) link to this user.

properties

A list of additional properties that specify user account settings.

roles

The list of roles directly assigned to this user. Does not include roles inherited from user groups to which this user belongs.

groups

The list of user groups to which this user belongs.

locator

The locator required to access this user. Only used for POST requests.

avatars

The UserAvatars object that stores different sizes of a user profile picture.

enabled2FA

Returns true if the user configured the two-factor user authentication; otherwise, false.

Schema

Below, you can find a full schema of this object, in XML and JSON formats. You can choose what fields to submit depending on your current needs. Different methods might expect different fields: the best approach is to request this entity via GET and use the response as a base for the following POST request.

A link to another object implies that you can substitute it with the schema of the linked object, if it is required for your call.

<user email="string" enabled2FA="false" hasPassword="true" href="/app/rest/users/id:11" id="1" lastLogin="20241001T155514+0200" locator="null" name="John Doe" password="foobar" realm="string" username="johndoe"> <properties count="123" href="string"> <property>[[[property...|property.html]]]</property> </properties> <roles> <role>[[[roleAssignment...|roleassignment.html]]]</role> </roles> <groups count="2"> <group>[[[group...|group.html]]]</group> </groups> <avatars urlToSize20="/app/rest/avatars/id:1/20/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png" urlToSize28="/app/rest/avatars/id:1/28/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png" urlToSize32="/app/rest/avatars/id:1/32/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png" urlToSize40="/app/rest/avatars/id:1/40/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png" urlToSize56="/app/rest/avatars/id:1/56/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png" urlToSize64="/app/rest/avatars/id:1/64/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png" urlToSize80="/app/rest/avatars/id:1/80/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png"/> </user>
{ "lastLogin" : "20241001T155514+0200", "roles" : { "role" : [ "[[[roleAssignment...|roleassignment.html]]]" ] }, "groups" : { "count" : 2, "group" : [ "[[[group...|group.html]]]" ] }, "hasPassword" : true, "password" : "foobar", "enabled2FA" : false, "name" : "John Doe", "realm" : "realm", "id" : 1, "href" : "/app/rest/users/id:11", "locator" : "null", "email" : "email", "properties" : { "count" : 1, "property" : [ { "inherited" : true, "name" : "name", "type" : "[[[type...|type.html]]]", "value" : "value" } ], "href" : "href" }, "username" : "johndoe", "avatars" : { "urlToSize80" : "/app/rest/avatars/id:1/80/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png", "urlToSize28" : "/app/rest/avatars/id:1/28/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png", "urlToSize40" : "/app/rest/avatars/id:1/40/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png", "urlToSize32" : "/app/rest/avatars/id:1/32/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png", "urlToSize20" : "/app/rest/avatars/id:1/20/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png", "urlToSize64" : "/app/rest/avatars/id:1/64/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png", "urlToSize56" : "/app/rest/avatars/id:1/56/avatar.a0b4af01-0211-4216-b2de-c295b282b4b5.png" } }
Last modified: 02 December 2025