Back to Home
web2.auth

Delete Account

Request an emailed OTP, then confirm account deletion. Deletion makes the account dormant and hidden; re-registering with the same email reactivates the same principalId.

This is a soft deletion. The account becomes dormant and hidden from APIs, while compliance-retained data stays on record. Registering again with this email reactivates the same principalId and restores access to existing secrets.

Step 1

Request Account-Deletion OTP

Call web2.auth.requestAccountDeletion() with the registered email, password, and principalId. If they match a verified account, an OTP will be sent to your inbox.

const result = await web2.auth.requestAccountDeletion({
email: 'user@example.com',
password: 'securePassword123',
principalId,
blackboxUrl,
});
// result.message -> "OTP sent"
Step 2

Confirm Deletion

Enter the OTP from your email. Call web2.auth.confirmAccountDeletion() to make the account dormant and hidden.

await web2.auth.confirmAccountDeletion({
email, otp: '123456',
blackboxUrl,
});
// Account becomes dormant/hidden

Console Output

Waiting for action...