API call to unmask all emails

In the web interface there is an option for administrators to unmask all emails when examining the active user list. I don’t think that there is an API equivalent, although it would be useful. We have a case where we need to use email addresses as keys to synchronize our user list, and having to unmask each email one at a time generates enough API calls to (quickly) hit the built-in rate limiting.

Apologies if I missed this in the API documentation.

While it’s probably not in the API documentation (I haven’t checked), you can open your browser’s console and see the request made when clicking the unmask button as admin.

Then you’ll be able to use that same query in your code :wink:

4 Likes

Here’s the documentation: Reverse engineer the Discourse API.

4 Likes

Thanks so much guys! It’s working perfectly now.

FWIW, I was passing show_emails=1 as part of the query string, when what was needed was show_emails=true. Perhaps working with JavaScript has spoiled me WRT truthy values, but it would be nice the API was a bit more forgiving :slight_smile:.

4 Likes