# Cannot change user's email using Management API

**URL:** <https://community.auth0.com/t/cannot-change-users-email-using-management-api/60768>\
**Category:** Get Help\
**Tags:** api\
**Created:** [April 8, 2021, 12:48pm UTC](https://community.auth0.com/t/cannot-change-users-email-using-management-api/60768 "2021-04-08T12:48:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcastorina](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dcastorina/32/19790_2.png) [@dcastorina](https://community.auth0.com/u/dcastorina)\
**Post date:** [April 8, 2021, 12:48pm UTC](https://community.auth0.com/t/cannot-change-users-email-using-management-api/60768/1 "2021-04-08T12:48:43Z")

</div>

Hello,

I have been trying to use the Management API to change the user’s given\_name, family\_name and email and while the first two fields get successfully updated, the email does not.  
Following the docs and other threads I have included the connection parameter in the request and, since I am using a custom database connection, I have also configured the change\_email script using the API.

The error I get is the following:

```
{
     "statusCode": 400,
     "error": "Bad Request",
     "message": "The specified email should be a string",
     "errorCode": "auth0_idp_error"
}

```

The request body looks like this:

```
{"email": "user@example.com", "connection": "myconnection"}

```

The error message says the email should be a string and I am sure it is.

Can you please help?

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [April 8, 2021, 1:44pm UTC](https://community.auth0.com/t/cannot-change-users-email-using-management-api/60768/3 "2021-04-08T13:44:51Z")

</div>

Hi @dcastorina

Can you post your full PATCH here?

John

---

<div class="post-metadata">

**Author:** ![dcastorina](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dcastorina/32/19790_2.png) [@dcastorina](https://community.auth0.com/u/dcastorina)\
**Post date:** [April 8, 2021, 1:58pm UTC](https://community.auth0.com/t/cannot-change-users-email-using-management-api/60768/4 "2021-04-08T13:58:50Z")

</div>

Hi @john.gateley ,

The email\_address was not being returned by the get\_user script, fixed that and also the update is working!

Diego

---

<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:** [April 23, 2021, 1:59pm UTC](https://community.auth0.com/t/cannot-change-users-email-using-management-api/60768/5 "2021-04-23T13:59:05Z")

</div>

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