fetchProfile

abstract fun fetchProfile(): RelayProfile

Retrieves the profile for the authenticated user.

Returns a `RelayProfile` object containing subscription status, usage statistics, and account settings. The has_premium field indicates whether the user has an active premium subscription.

Errors

  • RelayApi: Returned for any non-successful (non-2xx) HTTP response. Provides the HTTP status and response body; downstream consumers can inspect these fields. If the response body is JSON with error_code or detail fields, these are parsed and included for more granular handling; otherwise, the raw response text is used as the error detail.

  • Network: Returned for transport-level failures, like loss of connectivity, with details in reason.

  • Other variants may be returned for unexpected deserialization, URL, or backend errors.