Problem statement: After Changing the custom domain in Auth0, how do we update email domains for users in Auth0 to match the new domain?
Solution:
- Get the list of user_ids by calling the Auth0 Management API Search User endpoint with
fields: user_id
q: email.domain:"old-domain.com" AND identities.connection:Username-Password-Authentication
- Update the email domain:
Approach #1:
Use the update users by id endpoint to change the email addresses.
Approach #2:
Click on the Edit button on the Email field in the Auth0 Dashboard.
Approach #3:
Perform a bulk update on multiple users at a time using the using Management API bulk import job ‘POST /api/v2/jobs/users-imports’
Reference:
https://community.auth0.com/t/how-to-bulk-update-user-profile-details-in-the-management-api/81198/2