B2B Saas Authentication

/

Frontend SDKs

/

Headless

/

Passwords

/

Discovery

/

Reset by Email Start

Reset by email start

The resetByEmailStart method wraps the Reset By Email Discovery Start Password API endpoint. If this method succeeds, an email will be sent to the provided email address with a link to reset the password.


Method parameters


email_address*string

reset_password_redirect_urlstring

discovery_redirect_urlstring

reset_password_expiration_minutesint

reset_password_template_idstring

Response fields


request_idstring

status_codeint
import React, { useCallback } from 'react';
import { useStytchB2BClient } from '@stytch/react/b2b';

export const ResetPasswordStart = () => {
  const stytch = useStytchB2BClient();

  const resetPasswordStart = useCallback(() => {
    stytch.passwords.resetByEmailStart({
      email_address: 'sandbox@stytch.com',
      organization_id: 'organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931',
    });
  }, [stytch]);

  return <button onClick={resetPasswordStart}>Reset Password</button>;
};

RESPONSE

200
{
    "status_code": 200,
    "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
}