Pulling Emails via API

AI-generated summary

Joe_F asks how to pull user emails via the API for all users, not just one. NateDhaliwal notes that while /admin/users/{id}.json doesn’t return emails, the /admin/users/list/{flag}.json endpoint does. Pfaffman suggests using the Data Explorer plugin, providing a sample query to fetch user data including email and activity, and explaining how to run the query via the API using a POST request to /admin/plugins/explorer/queries/{query_id}/run. Joe_F confirms the issue is resolved, thanking the community for the help Joe_F, NateDhaliwal, pfaffman.

Hi all,

I have set up a pipeline that pulls in all user information but the option to pull in their email is not available.

I have an admin role and the API key, etc, can I set this up, if so how? I want to add this column in a table for all users not a one off user query.

Kind regards, Joe

Interestingly, something like /admin/users/{id}.json doesn’t return the user’s email as part of the response, but getting a list of users (/admin/users/list/{flag}.json) does. If you pass a parameter like username, you can probably get the specific user.

I want to get a full list of users, their activity on the community and have their email also, it seems it is not an option though.

The data explorer plugin is probably the way to do that. And then you can request a particular query via the API.

Thanks, I had not seen this before, but seems this is not possible there unless I am missing something!

You could probably search here and find some examples or at ask.discourse.com, I asked

I’m unclear about who this link can work for:
https://ask.discourse.com/discourse-ai/ai-bot/shared-ai-conversations/oeofVCGwHrYuzKrtLV6PeQ

Solved it thanks!

You have been amazing!