When trying to update a single user through the Management API v2, I’ve encountered an error when trying to update the nickname field at the same time as either email or phone_number.
I get a 400 response with the error message “Cannot update email and nickname simultaneously” or “Cannot update phone_number and nickname simultaneously”.
What gives? Why does nickname have this kind of special restriction?
What type of connection this user belongs to? I just tested with a database connection user and was able to update email and nickname in the same call.
Database connection, same. In particular, we are using our custom database configured to gradually migrate to Auth0. When we migrate a user, we set the nickname at that time and do not have a problem pushing that to Auth0.
One other thing - I just noticed that the machine-to-machine application through which I’m using the API call was not listed as “using” the database connection (“Applications” tab of Database Connection).
But even when I toggled it on, and tried the API call again I got the same error as before: “Cannot update email and nickname simultaneously.”
I thought I’d close by sharing what a support professional told me:
This restriction is due to how we handle the relationship between the username and nickname fields in native Auth0 identity providers (i.e. database, custom database with import mode on) when the Requires Username feature is enabled.
Unfortunately, given your connection type we can’t remove this restriction.
They agreed that if you have to update bothnickname and email or username, it needs to be done in two separate API calls; that seems to be the best workaround.