Reads users and manages public user profiles and avatars.
Summary
Functions
Gets visible user rows for multiple stable user IDs. Unknown IDs are omitted from the response.
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.
Gets one visible user by user ID or login. Returns NOT_FOUND when the target is unknown.
Lists users visible to the authenticated user. Admin-sensitive account fields stay out of this public row shape.
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.
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.
Functions
@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.
@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.
@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.
@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.
@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.
@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.