resetByEmailStart

abstract suspend fun resetByEmailStart(request: IPasswordsEmailResetStartParameters): PasswordsEmailResetStartResponse

Initiates an email-based password reset by sending a reset link to the user's email address. Calls the POST /sdk/v1/passwords/email/reset/start endpoint. Generates and stores a PKCE code pair for use in the subsequent resetByEmail call.

Kotlin:

StytchConsumer.passwords.resetByEmailStart(
PasswordsEmailResetStartParameters(email = "user@example.com")
)

iOS:

let params = PasswordsEmailResetStartParameters(email: "user@example.com")
let response = try await StytchConsumer.passwords.resetByEmailStart(params)

React Native:

StytchConsumer.passwords.resetByEmailStart({ email: "user@example.com" })

Return

PasswordsEmailResetStartResponse confirming the reset email was sent.

Parameters

request
  • IPasswordsEmailResetStartParameters

  • email — The email address of the user requesting a password reset.

  • loginRedirectUrl? — URL to redirect the user to if they click the link but already have a valid session.

  • resetPasswordRedirectUrl? — URL to redirect the user to for completing the password reset.

  • resetPasswordExpirationMinutes? — Expiration for the reset link, in minutes.

  • resetPasswordTemplateId? — Custom email template ID for the reset email.

Throws

StytchError

if no user with the given email exists.

if the coroutine is cancelled.