Having an issue with Error 400 "The specified new email already exists" after email was previously changed


I am using the Management API and doing a basic update on a users email.

Scenario: (This is a testing scenario that will likely be rare in production)

I update the users email using the API api/v2/users/{id}

This update works fine and I verify that the email has been changed in the admin panel.

Then I go to do the same process only changing the email back to the original email.

I get the 400 error here “The specified new email already exists”

Is there some amount of time that an email would remain in the system after being changed.


Hey @david.pitzel :wave:

Do you have a Custom Database that uses the “Get User” script? I’ve encountered something like this when I had set up a Custom Database w/ Automatic Migration.

I believe the “Get User” script is called to make sure the email you are changing to does not already exist in your own identity data store outside of Auth0.

Hey @gparascandolo ,

Thanks for the response. It looks like we do have a “Get User” script. Since this fires on a pre trigger before I update our DB it makes perfect sense. Thanks for the heads up.

1 Like