In a Dev category discussion titled ‘Cases when admin/users.json?email=foobar or admin/users/list/all.json?email=foobar return empty array,’ Hyan reports receiving empty arrays ([]) when querying user endpoints via email, even for users who have created topics. They also note the absence of admin/users.json in official API docs. blake clarifies that /admin/users.json is still functional and shares the same backend as /admin/users/list/{flag}.json, suggesting documentation updates are needed. blake confirms that /admin/users.json returns new users without topics if the email is exact — and notes that encoding issues (e.g., unencoded + in emails) may cause empty responses. Hyan confirms the issue was due to improper URL encoding. Regarding admin/users/list/all.json?email, blake explains that ‘all’ is not a valid flag; instead, users should paginate through flags like active to retrieve all users. The discussion concludes with practical examples and reassurance that undocumented endpoints remain usable for now.
Per titled, when I run above endpoints I got [] response in Postman. Almost all [] if users foobar has no topic created, but there’s one user who has just created a topic the above query response with [] too, while I think both of them should always return users info as those basic info (registered ip, user name) are users info when they just created their account.
BTW, I cannot find endpoint of admin/users.json in https://docs.discourse.org/. Is it removed and supposed not to use anymore. Thanks!
What if I still call admin/users.json, will I get 404 or I can keep using it in my code. My discourse installation version is 3.4.0.beta2, means I can still use admin/users.json?
Ya its totally fine. You can keep using /admin/users.json. It uses the exact same underlying code as as /admin/users/list/{flag}.json. That’s probably one of the reasons it hasn’t been documented yet.
I’m able to get /admin/users.json to return a brand new user without any topics.
Thank you @blake. It’s may fault that I didn’t encode mark + in query string, that causes the empty response. With correct encoding the expect results returned.
I assume the same reason for admin/users/list/all.json?email thought it doesn’t appear in docs.