Skip to main content
To use the email verification feature, contact our support team to enable it on your account.
When you send a verification request for an email address, Prelude will send an email with an OTP code to the email address. The user will then receive the email and enter the OTP code in your application to verify their email address. The email verification feature follows the same verification lifecycle as the phone number verification. The content of the email sent to your users can be customized to your brand in a similar way to the SMS verification messages. For more information, see the Message Content documentation. You can also specify a custom email address to send the verification email from. For more information, contact our support team to set this up on your account. To verify an email address, you can use the POST /v2/verification endpoint with the target.type parameter set to email_address and the target.value parameter set to the email address you want to verify.
import Prelude from "@prelude.so/sdk";

const client = new Prelude();

async function main() {
  const verification = await client.verification.create({
    target: {
      type: "email_address",
      value: "john.doe@example.com",
    },
  });

  console.log(verification.id);
}

main();