# `Chatto.Api.V1.UserService`
[🔗](https://github.com/xtian/elixir-chatto/blob/v0.1.0/lib/chatto/generated/chatto_api_v1_user_service.ex#L3)

Reads users and manages public user profiles and avatars.

# `batch_get_users`

```elixir
@spec batch_get_users(Req.Request.t(), Chatto.Api.V1.BatchGetUsersRequest.t()) ::
  {:ok, Chatto.Api.V1.BatchGetUsersResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Gets visible user rows for multiple stable user IDs. Unknown IDs are
omitted from the response.

# `delete_avatar`

```elixir
@spec delete_avatar(Req.Request.t(), Chatto.Api.V1.DeleteAvatarRequest.t()) ::
  {:ok, Chatto.Api.V1.DeleteAvatarResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Deletes the target user's avatar. Authorization matches UploadAvatar. The
call is idempotent. Unknown or deleted targets return NOT_FOUND. An
invalid ID returns INVALID_ARGUMENT.

# `get_user`

```elixir
@spec get_user(Req.Request.t(), Chatto.Api.V1.GetUserRequest.t()) ::
  {:ok, Chatto.Api.V1.GetUserResponse.t()} | {:error, Chatto.Connect.Error.t()}
```

Gets one visible user by user ID or login. Returns NOT_FOUND when the
target is unknown.

# `list_users`

```elixir
@spec list_users(Req.Request.t(), Chatto.Api.V1.ListUsersRequest.t()) ::
  {:ok, Chatto.Api.V1.ListUsersResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Lists users visible to the authenticated user. Admin-sensitive account
fields stay out of this public row shape.

# `update_user_profile`

```elixir
@spec update_user_profile(Req.Request.t(), Chatto.Api.V1.UpdateUserProfileRequest.t()) ::
  {:ok, Chatto.Api.V1.UpdateUserProfileResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Updates the target user's login, display name, and/or bio. Users can
update themselves. Updating another human requires user.manage-accounts.
A caller who updates another bot needs ownership of the bot,
user.manage-accounts, or bot.manage. Bot callers use the same permission checks.
A login change returns FAILED_PRECONDITION while the target's
username-change cooldown is active. A successful login change starts a
new cooldown. This also applies when a bot owner or bot manager changes a
bot's login. A caller with user.manage-accounts bypasses the cooldown and
does not start it. A case-only change does not check or start the
cooldown. Unknown or deleted targets return NOT_FOUND. An invalid ID or a
request without a selected field returns INVALID_ARGUMENT.

# `upload_avatar`

```elixir
@spec upload_avatar(Req.Request.t(), Chatto.Api.V1.UploadAvatarRequest.t()) ::
  {:ok, Chatto.Api.V1.UploadAvatarResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Uploads and sets an avatar for the target user. Users can update
themselves. Updating another human requires user.manage-accounts.
A caller who updates another bot needs ownership of the bot,
user.manage-accounts, or bot.manage.
Bot callers use the same permission checks. Unknown or deleted targets return
NOT_FOUND. Invalid IDs or missing images return INVALID_ARGUMENT.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
