send

abstract suspend fun send(request: IB2BOTPsEmailDiscoverySendParameters): B2BOTPsEmailDiscoverySendResponse

Sends a discovery email OTP to enumerate the organizations associated with the given email address. Calls the POST /sdk/v1/b2b/otps/email/discovery/send endpoint.

Kotlin:

StytchB2B.otp.email.discovery.send(
B2BOTPsEmailDiscoverySendParameters(emailAddress = "user@example.com")
)

iOS:

let params = B2BOTPsEmailDiscoverySendParameters(emailAddress: "user@example.com")
let response = try await StytchB2B.otp.email.discovery.send(params)

React Native:

StytchB2B.otp.email.discovery.send({ emailAddress: "user@example.com" })

Return

B2BOTPsEmailDiscoverySendResponse confirming the discovery OTP was sent.

Parameters

request
  • IB2BOTPsEmailDiscoverySendParameters

  • emailAddress — The email address to send the discovery OTP to.

  • loginTemplateId? — Custom email template ID for the discovery email.

  • locale? — Locale for the email content.

  • discoveryExpirationMinutes? — Expiration time for the discovery OTP, in minutes.

Throws

StytchError

if the request fails.

if the coroutine is cancelled.