Developer Portal for YouTrack and Hub Help

Operations with a Specific User

This resource provides access to a specific user in Hub and YouTrack.

Resource

<Hub Service URL>/api/rest/users/{userID}

Returned entity

User. For the description of the entity attributes, see User Attributes.

Supported methods

User Attributes

Represents a user in Hub and YouTrack.

Attributes

This table describes attributes of the User entity.

  • To receive an attribute in the response from the server, specify it explicitly in the fields request parameter.

  • To update an attribute, provide it in the body of a POST request.

Field

Type

Description

id

String

The unique identifier of the user. Read-only.

aliases

Set.<alias>

The set of IDs of user accounts that have been merged into this account.

avatar

avatar

The avatar of the user.

banned

Boolean

This flag indicates whether the user account is banned. true when the account is banned, otherwise false.

creationTime

Long

The timestamp when the user account was created.

details

Set.<details>

A set of login credentials associated with the account. These credentials point to various built-in and federated authentication modules.

groups

Set.<userGroup>

The list of groups where the user belongs.

guest

Boolean

This flag indicates whether the user account is the guest account. true when the account is guest, otherwise false.

lastAccessTime

Long

The timestamp when the user account last logged in to the system.

licenses

Set.<license>

The list of licenses that the user has.

login

String

The login of the user.

name

String

The full name of the user.

permanentTokens

Set.<permanentToken>

The list of permanent tokens of the user.

profile

profile

The user profile details, such as email, locale preferences, and custom user attributes.

favoriteProjects

Set.<project>

The set of favourite projects of the user.

projectRoles

Set.<projectRole>

The set of project roles that this user has been granted directly.

teams

Set.<projectTeam>

The list of project teams where the user belongs.

type

String

The type of the entity. In this case, it's user.

userType

userType

The type of the user account.

VCSUserNames

Set.<vcsUserName>

The list of VCS usernames of the user.

Read a Specific User

Get the specific user.

Request Syntax

GET <Hub Service URL>/api/rest/users/{userID}?{fields}

Request Parameters

Parameter

Type

Description

fields

String

Optional. Returns only the specified subset of the fields for the user. Use Fields Syntax to define the subset.

Sample

Request

https://example.youtrack.cloud/hub/api/rest/users/7a0573d6-a39e-4724-80e7-081acb8d2c99?fields=login,banned,banReason,banBadge,guest,creationTime,lastAccessTime

Response Body

{ "type": "user", "id": "7a0573d6-a39e-4724-80e7-081acb8d2c99", "login": "william.johnson", "banned": false, "guest": false, "creationTime": 1645019022409 }

Update a Specific User

Update a specific user.

Request Syntax

POST <Hub Service URL>/api/rest/users/{userID}?fields=string

Request Parameters

Parameter

Type

Description

fields

String

A list of User attributes that should be returned in the response. If no field is specified, only the entityID is returned.

Sample

In this sample, we are updating the full name of a specific user.

Request

https://example.youtrack.cloud/hub/api/rest/users/7a0573d6-a39e-4724-80e7-081acb8d2c99?fields=id,login,name

Request Body

{ "name": "Will Johnson" }

Response Body

{ "type": "user", "id": "7a0573d6-a39e-4724-80e7-081acb8d2c99", "name": "Will Johnson", "login": "william.johnson" }

Delete a Specific User

Delete a specific user.

Request Syntax

DELETE <Hub Service URL>/api/rest/users/{userID}?fields=string

Request Parameters

Parameter

Type

Description

fields

String

A list of User attributes that should be returned in the response. If no field is specified, only the entityID is returned.

Sample

In this sample, we are deleting a specific user.

Request

https://example.youtrack.cloud/hub/api/rest/users/fde92ae3-e86d-4da9-a90d-433ab58d74ae
Last modified: 7 November 2024