# How to save user\_id in to my database?

**URL:** <https://community.auth0.com/t/how-to-save-user-id-in-to-my-database/60554>\
**Category:** Get Help\
**Tags:** jwt, api, rules, management-api, login\
**Created:** [April 5, 2021, 12:20pm UTC](https://community.auth0.com/t/how-to-save-user-id-in-to-my-database/60554 "2021-04-05T12:20:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![minh.d.nguyen2211](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/minh.d.nguyen2211/32/28583_2.png) [@minh.d.nguyen2211](https://community.auth0.com/u/minh.d.nguyen2211)\
**Post date:** [April 5, 2021, 12:20pm UTC](https://community.auth0.com/t/how-to-save-user-id-in-to-my-database/60554/1 "2021-04-05T12:20:38Z")

</div>

Hi,

I am implementing an app which user can log in and create profile page. Im using Auth0 React front end to do authentication. After user successfully signs up, i want to save user\_id into my database. I look through the documentation and see there is post user registration hook which is potentially useful to trigger a request to my server and save user\_id. But i wonder if there is failure either on Auth0 or on my side, then user is created but no user\_id saved on my side.

Is there any suggestion how to approach this problem?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 5, 2021, 7:35pm UTC](https://community.auth0.com/t/how-to-save-user-id-in-to-my-database/60554/3 "2021-04-05T19:35:11Z")

</div>

Hi @minh.d.nguyen2211,

Welcome to the Community!

If there is a failure the hook can retry.

Alternatively, when your backend can’t find a userID in the database, it could create a new user with the ID from the token.

---

<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:** [April 20, 2021, 7:35pm UTC](https://community.auth0.com/t/how-to-save-user-id-in-to-my-database/60554/4 "2021-04-20T19:35:41Z")

</div>

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