How to update email and phone_number simultaneously on update user call?

I am trying to update user email and phone_number using patch /api/v2/users/{id} but getting "Cannot update email and phone_number simultaneously" error.

I understand that there are some cases mentioned where I cannot update certain combination simultaneously, but I do not see this on the doc. Unless the doc is not up-to-date. What am I missing here?

If this is Auth0 restriction, what is the recommended approach to do so?

Request:

{
  "given_name": "LastName",
  "family_name": "firstName",
  "email": "test@email.com",
  "phone_number": "+19999999999"
}

Response:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "Cannot update email and phone_number simultaneously",
    "errorCode": "operation_not_supported"
}

Hi @Gunjan.Parmar ,

Thank you for posting this topic on the Auth0 Community!

The email and phone_number are associated with Email and SMS connections respectively. They are the two types of connections for the Passwordless Authentication.




A user can have either the SMS connection type, for which we can only update the phone number, or the Email connection type, for which we can only update the email. Therefore we can not update both fields simultaneously.

Hope this helps!

1 Like

Hello Lihua,
What if my connection type is Username-Password-Authentication?

Hi @Gunjan.Parmar ,

For Username-Password-Authentication connection, the phone number field is not in the UI if checking the setting of the user and we can not update it.

1 Like

Got it. As always, thank you so much for your help.

You are very welcome :grin: