API Endpoint to Retrieve Community Emails Addresses

I was hoping somebody can point me to where I can set my endpoint to retrieve via API callout users email addresses associate with my organizations specific community.

I can hit the end point of active users, new users and others; however, the associated email does not return for any other user other than my account.

Thank you.

Maybe this:
https://meta.discourse.org/t/api-best-way-to-get-user-details-by-email/20806/10?u=dax

3 Likes

This only looks to return my email - and no one else’s. In fact, the "email": endpoint is only visible for my user

I’m seeing the same problem with the users/list API call. The email addresses are not being returned, and I’m using an API key generated for the system user, which should be all-powerful?

The API documentation definitely says that “email” should be non-empty.

I’m using v1.9.2.

I’ve found the answer here:

https://meta.discourse.org/t/email-address-no-longer-being-exposed-on-discourse-api/21109

The API has changed.

2 Likes

Does anyone know the current status on looking up email addresses with the API? (The linked page doesn’t exist.)

The API docs say that email should be returned from /admin/users/{id}.json, but it’s missing when I make requests there.

I have a list of Discourse usernames, and I’m trying to get their email addresses to match them with their email addresses in another system.

# I'm getting the user ID from here:
f"{BASE_URL}/u/{username}.json"

# and then trying to fetch the email address from here:
f"{BASE_URL}/admin/users/{user_id}.json"

If email isn’t available there any more, is there another way to programmatically get it from the username?

I found another way by looking at the web requests in the browser. This URL works:

f"{BASE_URL}/u/{username}/emails.json"
1 Like