resetStart

abstract suspend fun resetStart(request: IB2BDiscoveryPasswordResetStartParameters): B2BDiscoveryPasswordResetStartResponse

Sends a password reset email to the specified address for use in the cross-org discovery flow. Calls the POST /sdk/v1/b2b/passwords/discovery/reset/start endpoint. Stores a PKCE code challenge for verification when reset is called.

Kotlin:

StytchB2B.discovery.passwords.resetStart(
B2BDiscoveryPasswordResetStartParameters(
emailAddress = "user@example.com",
discoveryRedirectUrl = "myapp://discovery",
)
)

iOS:

let params = B2BDiscoveryPasswordResetStartParameters(
emailAddress: "user@example.com",
discoveryRedirectUrl: "myapp://discovery"
)
let response = try await StytchB2B.discovery.passwords.resetStart(params)

React Native:

StytchB2B.discovery.passwords.resetStart({
emailAddress: "user@example.com",
discoveryRedirectUrl: "myapp://discovery",
})

Return

B2BDiscoveryPasswordResetStartResponse confirming the reset email was sent.

Parameters

request
  • IB2BDiscoveryPasswordResetStartParameters

  • emailAddress — The user's email address.

  • discoveryRedirectUrl? — URL to redirect to after the reset flow completes.

  • resetPasswordRedirectUrl? — URL embedded in the reset email link.

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

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

  • locale? — Locale for the reset email.

  • verifyEmailTemplateId? — Custom email template ID for email verification.

Throws

StytchError

if the email address is not found or the request fails.

if the coroutine is cancelled.