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

**URL:** <https://community.auth0.com/t/having-an-issue-with-error-400-the-specified-new-email-already-exists-after-email-was-previously-changed/118349>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [October 11, 2023, 6:35pm UTC](https://community.auth0.com/t/having-an-issue-with-error-400-the-specified-new-email-already-exists-after-email-was-previously-changed/118349 "2023-10-11T18:35:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.pitzel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/david.pitzel/32/50781_2.png) [@david.pitzel](https://community.auth0.com/u/david.pitzel)\
**Post date:** [October 11, 2023, 6:35pm UTC](https://community.auth0.com/t/having-an-issue-with-error-400-the-specified-new-email-already-exists-after-email-was-previously-changed/118349/1 "2023-10-11T18:35:34Z")

</div>

Hello,

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.

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![gparascandolo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gparascandolo/32/38788_2.png) [@gparascandolo](https://community.auth0.com/u/gparascandolo)\
**Post date:** [October 11, 2023, 9:21pm UTC](https://community.auth0.com/t/having-an-issue-with-error-400-the-specified-new-email-already-exists-after-email-was-previously-changed/118349/2 "2023-10-11T21:21:25Z")

</div>

Hey @david.pitzel 👋

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.

---

<div class="post-metadata">

**Author:** ![david.pitzel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/david.pitzel/32/50781_2.png) [@david.pitzel](https://community.auth0.com/u/david.pitzel)\
**Post date:** [October 11, 2023, 9:30pm UTC](https://community.auth0.com/t/having-an-issue-with-error-400-the-specified-new-email-already-exists-after-email-was-previously-changed/118349/3 "2023-10-11T21:30:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 2, 2024, 2:32pm UTC](https://community.auth0.com/t/having-an-issue-with-error-400-the-specified-new-email-already-exists-after-email-was-previously-changed/118349/4 "2024-08-02T14:32:22Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
