# Undocumented validation when updating user email with management api

**URL:** <https://community.auth0.com/t/undocumented-validation-when-updating-user-email-with-management-api/68621>\
**Category:** Get Help\
**Tags:** update-user-email, email, api, management-api, auth0\
**Created:** [August 26, 2021, 1:34pm UTC](https://community.auth0.com/t/undocumented-validation-when-updating-user-email-with-management-api/68621 "2021-08-26T13:34:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlyle99](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jlyle99/32/12842_2.png) [@jlyle99](https://community.auth0.com/u/jlyle99)\
**Post date:** [August 26, 2021, 1:34pm UTC](https://community.auth0.com/t/undocumented-validation-when-updating-user-email-with-management-api/68621/1 "2021-08-26T13:34:23Z")

</div>

Using PATCH /api/v2/users/{id} to update just the user’s email address when receiving an email change request in our internal system, I’m getting the following error message on a 400 response:

“Payload validation error: ‘Expected type string but found type null’ on property password (New Password for the user (mandatory for non-SMS connections)).”

…which is not identified as a possible 400 response in the documentation:

> **[Auth0 Management API v2](https://auth0.com/docs/api/management/v2?&_ga=2.65728366.1385004250.1629983016-590037402.1626200046&_gl=1*ielyor*rollup_ga*NTkwMDM3NDAyLjE2MjYyMDAwNDY.*rollup_ga_F1G3E656YZ*MTYyOTk4MzAxNi4xMy4xLjE2Mjk5ODMwOTguNTY.#!/Users/patch_users_by_id)**

For our use case, we do not want to update the user’s password in this scenario. Given that this is undocumented behavior, I’m curious if there are undocumented ways around the problem as well. Does anyone have a solution or work-around for this issue? I can supply additional test data as required.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [August 26, 2021, 9:38pm UTC](https://community.auth0.com/t/undocumented-validation-when-updating-user-email-with-management-api/68621/3 "2021-08-26T21:38:04Z")

</div>

Hi @jlyle99,

Welcome to the Auth0 Community!

Can you post a code snippet of the exact request you are making (scrubbed of sensitive data)?

---

<div class="post-metadata">

**Author:** ![jlyle99](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jlyle99/32/12842_2.png) [@jlyle99](https://community.auth0.com/u/jlyle99)\
**Post date:** [August 30, 2021, 2:17pm UTC](https://community.auth0.com/t/undocumented-validation-when-updating-user-email-with-management-api/68621/4 "2021-08-30T14:17:01Z")

</div>

Thanks, Dan!

I found the issue myself late in the week:

I thought I was sending this request body:

```auto
{
  "email": "john.doe@gmail.com",
  "connection": "XXXXXXX",
  "client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
}

```

But I was in fact sending this:

```auto
{
  "email": "john.doe@gmail.com",
  "password": null
  "connection": "XXXXXXX",
  "client_id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
}

```

…due to a stray commit that mixed up our requests for updating password and email and left both parameters in the body. Some additional logging showed this.

I do think it would be helpful to have the validation response syntax added to the docs, but this problem is resolved.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [August 31, 2021, 3:01pm UTC](https://community.auth0.com/t/undocumented-validation-when-updating-user-email-with-management-api/68621/5 "2021-08-31T15:01:07Z")

</div>

Glad that you figured it out. Thanks for following up with us!

---

<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:** [September 15, 2021, 3:01pm UTC](https://community.auth0.com/t/undocumented-validation-when-updating-user-email-with-management-api/68621/6 "2021-09-15T15:01:37Z")

</div>

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