Problem statement
We are able to set the phone number value using login migration script at the user profile level for an Auth0 user (Database connection) but if we try to update the phone number using Management API we get an error saying the operation is not supported for non-sms users.
{
"statusCode": 400,
"error": "Bad Request",
"message": "Cannot update phone_number for non-sms user",
"errorCode": "operation_not_supported"
}
Cause
As mentioned in this doc:
a user’s phone number is valid only for passwordless SMS users.
Solution
Saving the user’s phone number under the user_metadata field is the correct solution for users from regular database connections.