# Can I add email address to the access token when calling an api?

**URL:** <https://community.auth0.com/t/can-i-add-email-address-to-the-access-token-when-calling-an-api/70163>\
**Category:** Get Help\
**Tags:** api\
**Created:** [September 23, 2021, 3:37pm UTC](https://community.auth0.com/t/can-i-add-email-address-to-the-access-token-when-calling-an-api/70163 "2021-09-23T15:37:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trondhindenes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/trondhindenes/32/6352_2.png) [@trondhindenes](https://community.auth0.com/u/trondhindenes)\
**Post date:** [September 23, 2021, 3:37pm UTC](https://community.auth0.com/t/can-i-add-email-address-to-the-access-token-when-calling-an-api/70163/1 "2021-09-23T15:37:53Z")

</div>

I’m following this guide: [The Complete Guide to React User Authentication with Auth0](https://auth0.com/blog/complete-guide-to-react-user-authentication)  
Everything works, but I need to get a few basic details about the user in the api code, primarily the user’s email address.

I guess my question is:

- Is there any way to affect the data in the access token retrived here? `const { getAccessTokenSilently } = useAuth0();` Can I somehow indicate that I’d like to add the user’s emai added to that token?
- What is otherwise the preferred method for an api to get more information (such as the user’s email) about the calling user?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 23, 2021, 5:47pm UTC](https://community.auth0.com/t/can-i-add-email-address-to-the-access-token-when-calling-an-api/70163/3 "2021-09-23T17:47:34Z")

</div>

Hi @trondhindenes,

Thanks for reaching out to the Auth0 Community.

> [@trondhindenes](#):
>
> Is there any way to affect the data in the access token retrived here? `const { getAccessTokenSilently } = useAuth0();` Can I somehow indicate that I’d like to add the user’s emai added to that token?

Yes! I recommend using the `Add email to access token` rule to add the user’s email address to the access token. Navigate to your [Dashboard \> Auth0Pipeline \> Rules \> Create](https://manage.auth0.com/#/rules/new) and select the `Add email to access token` rule.

For the complete list of User Object Properties, take a look at this documentation: [https://auth0.com/docs/rules/user-object-in-rules](https://auth0.com/docs/rules/user-object-in-rules)

After doing so, you can use the Access Token to access your API that contains information about the user’s email address in the payload.

Please let me know if this addresses your questions.

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 11, 2021, 6:29pm UTC](https://community.auth0.com/t/can-i-add-email-address-to-the-access-token-when-calling-an-api/70163/4 "2021-10-11T18:29:57Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
