Change Users email address using the API without sending the confirmation Email

AI-generated summary

Updating User Email Address Using the API Without Sending Confirmation Email

A user, skodali, is looking for a way to update a user’s email address using the API without sending a confirmation email. They’ve tried deactivating the user, updating the email, and reactivating, but the user still receives a confirmation email and the account isn’t updated until the link is clicked.

simon suggests using the /admin/users/sync_sso route, which doesn’t send a confirmation email, but this requires using Single Sign-On (SSO). skodali inquires if SSO is the only option, and simon confirms that it was the only way he found to update the email without requiring the user to click on a confirmation email.

Regarding implementation, shahidmir asks if there’s a Java SDK for carrying out the sync_sso operation, and sam advises using the same payload as SSO, suggesting to use existing server-side code.

I am a new discourse user and I ran into a use case where I have to update the user email address using the API. Discourse is sending out an email to the new email address for verification. Is there a way to update the user email address without sending the confirmation email?

I tired another approach where I first deactivate the user, update the email and activate the user as suggested in other posts but the user is still getting the confirmation email. The user account is only getting updated after the link in the confirmation email is clicked. I want to do this without the confirmation email.

Any help on this is appreciated. Thanks.

If you are using SSO you can update the email address through the /admin/users/sync_sso route. When it’s done that way a confirmation email isn’t sent.

I am not using SSO, Is using SSO the only option?

I did some quick tests with this a few weeks ago. The sync_sso method was the only way I could find to do it that wouldn’t require the user to click on a confirmation email.

is there a Java SDK to carry out the sync_sso in a java application?

regards
shahid

sync_sso uses the exact same payload as SSO does, so use whatever code you have for your server side.