# API find email address, or search?

**URL:** https://meta.discourse.org/t/api-find-email-address-or-search/131055
**Category:** Development
**Created:** [October 15, 2019, 4:10pm UTC](https://meta.discourse.org/t/api-find-email-address-or-search/131055 "2019-10-15T16:10:32Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![alank](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@alank](https://meta.discourse.org/u/alank)
#### Post date: [October 15, 2019, 4:10pm UTC](https://meta.discourse.org/t/api-find-email-address-or-search/131055/1 "2019-10-15T16:10:32Z")

</div>

I’ve read a discourse post, thinking I had found it " `SITENAME.com/admin/users/list/all.json?email=some@email.com` which is what I need, that is verify if our SSO site has a Discourse member, via query of the Discourse API (from our API) but how, as the link above doesn’t work and if I could simply get a list of all users I’d implement the filter/result based on email address.

I think this is very protected or non-accessable, or is there a way?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [October 15, 2019, 4:41pm UTC](https://meta.discourse.org/t/api-find-email-address-or-search/131055/2 "2019-10-15T16:41:16Z")

</div>

That route should still work (just tested it).

For SSO you could also use `by-external`.  
See [Discourse API Docs](https://docs.discourse.org/#tag/Users/paths/~1u~1by-external~1%7Bexternal_id%7D.json/get)

---

<div class="post-metadata">

### Author: ![alank](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@alank](https://meta.discourse.org/u/alank)
#### Post date: [October 16, 2019, 12:45pm UTC](https://meta.discourse.org/t/api-find-email-address-or-search/131055/3 "2019-10-16T12:45:36Z")

</div>

@RGJ you are right! It does work!!! Something with my Postman requests tests are broken. ☹

However with SuperAgent request such as:

```plaintext
let res = await superagent.get(`${this.baseUrl}/admin/users/list/active`)
          .query({show_emails: true})
          .set('Api-Key', this.apiKey)
          .set('Api-Username', this.defaultDiscourseUser)
          .set('Content-Type', 'application/json')
          .set('Accept', 'application/json')

```

I was able to get the emails.

My apologies, however it would be nice to have an API request that simply returns true/false if an email exists, for now I’m pulling all users (a response that is a little heavy since it returns all user info) while all I want is to verify if the email exists - in fact I just want a true/false from Discourse if the user has logged in there first before coming to our site.

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [October 16, 2019, 12:52pm UTC](https://meta.discourse.org/t/api-find-email-address-or-search/131055/4 "2019-10-16T12:52:23Z")

</div>

With

```plaintext
superagent.get(`${this.baseUrl}/admin/users/list/all.json?email=${emailAddress}`)

```

you’re not pulling all the users.

---

<div class="post-metadata">

### Author: ![alank](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@alank](https://meta.discourse.org/u/alank)
#### Post date: [October 17, 2019, 1:06pm UTC](https://meta.discourse.org/t/api-find-email-address-or-search/131055/5 "2019-10-17T13:06:08Z")

</div>

Oh wow, thanks for that! This will get only one user and email? Works for me! Great!!!
