# Why getUserById doesn't return the user's email?

**URL:** https://meta.discourse.org/t/why-getuserbyid-doesnt-return-the-users-email/249084
**Category:** Development
**Created:** [December 16, 2022, 12:05am UTC](https://meta.discourse.org/t/why-getuserbyid-doesnt-return-the-users-email/249084 "2022-12-16T00:05:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Lucas\_Alves](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lucas_alves/32/285677_2.png) [@Lucas\_Alves](https://meta.discourse.org/u/Lucas_Alves)
#### Post date: [December 16, 2022, 12:05am UTC](https://meta.discourse.org/t/why-getuserbyid-doesnt-return-the-users-email/249084/1 "2022-12-16T00:05:55Z")

</div>

I’m currently working with the webhooks, but the only way that I have to link my users with treehouse is through email.

Why that field doesn’t return when we’re using `https://{defaultHost}/admin/users/{id}.json `?

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [December 16, 2022, 12:42am UTC](https://meta.discourse.org/t/why-getuserbyid-doesnt-return-the-users-email/249084/2 "2022-12-16T00:42:58Z")

</div>

It doesn’t exactly reply to your question, but does this help?

> [@Is there a way to get a user email adress from the API?](https://meta.discourse.org/t/is-there-a-way-to-get-a-user-email-adress-from-the-api/90637/2):
>
> GET /users/[username]/emails.json slight_smile

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/e/9/8e95bbe096a25e3b491b77117c811bb1f8f72178.png)

* * *

> **Probably of no use for your case since you can't dynamically change the user's ID as far as I know**
>
> [Run Data Explorer queries with the Discourse API](https://meta.discourse.org/t/run-data-explorer-queries-with-the-discourse-api/120063)
> 
> ![image](https://global.discourse-cdn.com/meta/original/4X/a/c/a/acae8d5117475cddac5ddce6701cc71a2b8351d1.png)
> 
> ![image](https://global.discourse-cdn.com/meta/original/4X/5/e/1/5e1d977ac4dfe72328a1b508bd9145510d4288a9.png)

---

<div class="post-metadata">

### Author: ![Lucas\_Alves](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lucas_alves/32/285677_2.png) [@Lucas\_Alves](https://meta.discourse.org/u/Lucas_Alves)
#### Post date: [December 16, 2022, 1:13am UTC](https://meta.discourse.org/t/why-getuserbyid-doesnt-return-the-users-email/249084/3 "2022-12-16T01:13:17Z")

</div>

I used this way but will be another request just to retrieve the email.  
Would be better if the email would return with the username and name at the `https://{defaultHost}/admin/users/{id}.json`
