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

Self-service account, display preference, presence, custom-status,
external identity, and account lifecycle commands for the authenticated
user. Public profile and avatar changes use UserService.

# `change_password`

```elixir
@spec change_password(Req.Request.t(), Chatto.Api.V1.ChangePasswordRequest.t()) ::
  {:ok, Chatto.Api.V1.ChangePasswordResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Updates or adds the authenticated user's password.

# `confirm_email_verification`

```elixir
@spec confirm_email_verification(
  Req.Request.t(),
  Chatto.Api.V1.ConfirmEmailVerificationRequest.t()
) ::
  {:ok, Chatto.Api.V1.ConfirmEmailVerificationResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Confirms a verification code and adds the address to the account. Returns
INVALID_ARGUMENT when the code is invalid or expired, and ALREADY_EXISTS
when another user already controls the address. Returns FAILED_PRECONDITION
when the authenticated account does not match expected_user_id.

# `delete_custom_status`

```elixir
@spec delete_custom_status(
  Req.Request.t(),
  Chatto.Api.V1.DeleteCustomStatusRequest.t()
) ::
  {:ok, Chatto.Api.V1.DeleteCustomStatusResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Deletes the current user's custom status. The call is idempotent and returns
the resulting empty status state.

# `delete_my_account`

```elixir
@spec delete_my_account(Req.Request.t(), Chatto.Api.V1.DeleteMyAccountRequest.t()) ::
  {:ok, Chatto.Api.V1.DeleteMyAccountResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Permanently deletes the authenticated account after token validation.
Requires user.delete-self.

# `disconnect_external_identity`

```elixir
@spec disconnect_external_identity(
  Req.Request.t(),
  Chatto.Api.V1.DisconnectExternalIdentityRequest.t()
) ::
  {:ok, Chatto.Api.V1.DisconnectExternalIdentityResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Disconnects a provider identity from the authenticated account.

# `get_presence_preference`

```elixir
@spec get_presence_preference(
  Req.Request.t(),
  Chatto.Api.V1.GetPresencePreferenceRequest.t()
) ::
  {:ok, Chatto.Api.V1.GetPresencePreferenceResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Reads the authenticated account's private saved availability choice.

# `get_settings`

```elixir
@spec get_settings(Req.Request.t(), Chatto.Api.V1.GetSettingsRequest.t()) ::
  {:ok, Chatto.Api.V1.GetSettingsResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Reads the authenticated user's display preferences without changing them.
Returns default settings when none have been saved.

# `list_external_identities`

```elixir
@spec list_external_identities(
  Req.Request.t(),
  Chatto.Api.V1.ListExternalIdentitiesRequest.t()
) ::
  {:ok, Chatto.Api.V1.ListExternalIdentitiesResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Lists configured external identity providers and identities linked to the
authenticated account.

# `list_verified_emails`

```elixir
@spec list_verified_emails(
  Req.Request.t(),
  Chatto.Api.V1.ListVerifiedEmailsRequest.t()
) ::
  {:ok, Chatto.Api.V1.ListVerifiedEmailsResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Lists the authenticated user's verified email addresses and primary choice.
Returns FAILED_PRECONDITION when the authenticated account does not match
expected_user_id.

# `refresh_presence`

```elixir
@spec refresh_presence(Req.Request.t(), Chatto.Api.V1.RefreshPresenceRequest.t()) ::
  {:ok, Chatto.Api.V1.RefreshPresenceResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Refreshes connection liveness without changing the saved choice. Clients call
every 30 seconds; liveness expires after 60 seconds without a refresh.
Accounts with a saved OFFLINE choice may refresh without public presence signals.

# `request_account_deletion`

```elixir
@spec request_account_deletion(
  Req.Request.t(),
  Chatto.Api.V1.RequestAccountDeletionRequest.t()
) ::
  {:ok, Chatto.Api.V1.RequestAccountDeletionResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Issues a short-lived token used to confirm self-deletion. Requires
user.delete-self.

# `request_email_verification`

```elixir
@spec request_email_verification(
  Req.Request.t(),
  Chatto.Api.V1.RequestEmailVerificationRequest.t()
) ::
  {:ok, Chatto.Api.V1.RequestEmailVerificationResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Sends a six-digit code to an email address that the authenticated user
wants to add. The code expires after the server-configured email OTP
lifetime. The client can request a new code after expiry. The server must
have transactional email enabled. Returns ALREADY_EXISTS when the address
is already verified for the user, RESOURCE_EXHAUSTED after too many code
requests or attempts, and UNAVAILABLE when email delivery is disabled or
fails. Returns FAILED_PRECONDITION when the authenticated account does not
match expected_user_id.

# `set_custom_status`

```elixir
@spec set_custom_status(Req.Request.t(), Chatto.Api.V1.SetCustomStatusRequest.t()) ::
  {:ok, Chatto.Api.V1.SetCustomStatusResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Sets the current user's complete custom status. Emoji and text are required.
Omit expires_at for no expiry, or supply a future time.

# `set_presence`

```elixir
@spec set_presence(Req.Request.t(), Chatto.Api.V1.SetPresenceRequest.t()) ::
  {:ok, Chatto.Api.V1.SetPresenceResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Legacy live presence report, expiring after 60 seconds without refresh.
A saved private choice overrides this report, including user_selected.
New clients use SetPresencePreference for choices and RefreshPresence
every 30 seconds for liveness.

# `set_presence_preference`

```elixir
@spec set_presence_preference(
  Req.Request.t(),
  Chatto.Api.V1.SetPresencePreferenceRequest.t()
) ::
  {:ok, Chatto.Api.V1.SetPresencePreferenceResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Saves a choice for all devices on this server. A stale revision returns ABORTED.
OFFLINE suppresses public presence and typing; the choice survives disconnects.

# `set_primary_email`

```elixir
@spec set_primary_email(Req.Request.t(), Chatto.Api.V1.SetPrimaryEmailRequest.t()) ::
  {:ok, Chatto.Api.V1.SetPrimaryEmailResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Selects one verified address for future account-directed email. Returns
NOT_FOUND when the address is not verified for the authenticated user, and
FAILED_PRECONDITION when the authenticated account does not match
expected_user_id.

# `start_external_identity_link`

```elixir
@spec start_external_identity_link(
  Req.Request.t(),
  Chatto.Api.V1.StartExternalIdentityLinkRequest.t()
) ::
  {:ok, Chatto.Api.V1.StartExternalIdentityLinkResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Creates a short-lived browser handoff URL for linking a provider identity
to the authenticated account. The provider callback completes through
chatto.auth.v1.ExternalIdentityAuthService.ConfirmExternalIdentityLink.

# `update_settings`

```elixir
@spec update_settings(Req.Request.t(), Chatto.Api.V1.UpdateSettingsRequest.t()) ::
  {:ok, Chatto.Api.V1.UpdateSettingsResponse.t()}
  | {:error, Chatto.Connect.Error.t()}
```

Updates the authenticated user's display preferences.

---

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