# Get user by ID

Gets user data by user ID.


{% html name="div" attrs={"class": "notice"} %}
Notice

Rate limits for server-side methods are applied to this method.
{% /html %}

Endpoint: GET /projects/{project_id}/users/search/by_id/{user_id}
Version: v1
Security: Server

## Path parameters:

  - `user_id` (string, required)
    User ID. You can find it in Publisher Account > your Login project > Users.

  - `project_id` (string, required)
    Login project ID from Publisher Account.

## Response 200 fields (application/json):

  - `ban` (object, required)
    User ban definition

  - `ban.date_from` (string, required)

  - `ban.date_to` (string, required)

  - `ban.reason` (string, required)

  - `email` (string)
    User email address.

  - `external_id` (string, required)
    ID of the user in your game.

  - `first_name` (string)
    User first name.

  - `groups` (array, required)
    List of groups the user belongs to.

  - `groups.id` (integer)
    User group ID

  - `groups.is_default` (boolean)
    Flag whether the group is the default group

  - `groups.is_deletable` (boolean)
    Flag whether the group can be deleted

  - `groups.name` (string)
    User group name

  - `id` (string, required)
    User ID.

  - `is_anonymous` (boolean)
    Shows whether the user is anonymous or not. The anonymous user is a user created via device ID or custom ID and doesn’t have an alternative authentication method added (e.g., username/email and password).

  - `is_last_email_confirmed` (boolean, required)
    Whether a user comfirmed their email address. If true, the email address is confirmed.

  - `is_user_active` (boolean, required)
    Shows whether the user is active or not.

  - `last_login` (string, required)
    Date of the last user login in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.

  - `last_name` (string)
    User last name.

  - `login_type` (string, required)
    Last used type of authorization. Can be xsolla_login/social/server_custom_id and etc

  - `name` (string)
    User name.

  - `nickname` (string)
    User nickname.

  - `phone_auth` (any, required)
    User phone number according to [national conventions](https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers). This phone number is used to authenticate the user. Returned only if the phone_auth field is specified.

  - `picture` (any, required)
    Link to the user profile picture.

  - `project_id` (string)
    ID of the project associated with a user.

  - `registered` (string, required)
    Date of user registration in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.

  - `server_custom_id` (string, required)
    User server_custom_id.

  - `username` (string, required)
    User username.

## Response 401 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Error code.
    Example: "003-061"

  - `error.description` (string, required)
    Error description.
    Example: "Object not found."

  - `error.details` (object)
    Additional information.

## Response 404 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Error code.
    Example: "003-061"

  - `error.description` (string, required)
    Error description.
    Example: "Object not found."

  - `error.details` (object)
    Additional information.


