Send a discovery OTP to an email address. The OTP is valid for 10 minutes. Only the most recently sent OTP is valid: when an OTP is sent, all OTPs previously sent to the same email address are invalidated, even if unused or unexpired.
Send Discovery Email OTP
POST
https://test.stytch.com/v1/b2b/otps/email/discovery/sendBody parameters
email_address* string
login_template_id string
locale string
discovery_expiration_minutes int
Response fields
request_id string
status_code int
const stytch = require('stytch');
const client = new stytch.B2BClient({
project_id: 'PROJECT_ID',
secret: 'SECRET',
});
const params = {
email_address: "sandbox@stytch.com",
};
client.otps.email.discovery.send(params)
.then(resp => { console.log(resp) })
.catch(err => { console.log(err) });
RESPONSE
200
{
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"status_code": 200
}