API - Best way to get user details by email

(Dean Taylor) #1

What is the best way to get a users username from email address via the API?

I used to use /admin/users/list/active.json?filter=john@example.com but recently a change as caused that to not return email addresses.

What is the best alternative?

How to check if a user existed or not based on email?
(Sam Saffron) #2

There should be a new API endpoint have a look in chrome dev tools.

(Dean Taylor) #3

@sam I understand Chrome Dev tools reveals the API endpoints.

The problem is that the active users search page no longer searches by email - only usernames.

What other pages allow searching via emails?

This input box used to allow emails - it doesn’t any longer.

(Sam Saffron) #4

That is a problem and an oversight @zogstrip @codinghorror we need a way for admins to search by email.

(Dean Taylor) #5

This is a big issue for me - currently my SSO sign up process is dependant on the ability to check to see if the user exists in Discourse by email address.

(Dean Taylor) #6

@sam does this need to be recategorised as a bug to avoid it being lost?

(Sam Saffron) #7

@zogstrip will be working on this tomorrow.

(Régis Hanol) #8

Sorry about that, it’s now fixed :snake:


(Régis Hanol) #9

(Sam Saffron) #10


If you are searching by email use:


Using filter is inefficient and not recommended for this use case!

Can not use new API to get a user by email
API Endpoint to Retrieve Community Emails Addresses