B2B Saas Authentication

/

Frontend SDKs

/

Headless

/

Members

/

Delete Self MFA Phone Number

Delete Self MFA phone number

The Delete Self MFA phone number method wraps the Delete Member MFA phone number API endpoint. The organization_id and member_id will be automatically inferred from the logged-in Member's session. This method can only be used to delete the logged-in Member's MFA phone number.

To change a Member's phone number, you must first call this endpoint to delete the existing phone number.

Existing Member Sessions that include a phone number authentication factor will not be revoked if the phone number is deleted, and MFA will not be enforced until the Member logs in again. If you wish to enforce MFA immediately after a phone number is deleted, you can do so by prompting the Member to enter a new phone number and calling the SMS OTP send endpoint, then calling the SMS Authenticate endpoint.

You can listen for successful Member updates anywhere in the codebase with the stytch.organization.onMemberChange() method or useStytchMember hook if you are using React.

import { useStytchB2BClient } from '@stytch/react/b2b';

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

  const deleteMFAPhoneNumber = () => {
    stytch.self.deleteMFAPhoneNumber();
  };

  return <button onClick={deleteMFAPhoneNumber}>Delete Phone Number</button>;
};

RESPONSE

200
{
    "member": {...},
    "member_id": "member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f",
    "organization": {...}
    "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
    "status_code": 200
}