# Post registration hook - post request

**URL:** <https://community.auth0.com/t/post-registration-hook-post-request/74170>\
**Category:** Get Help\
**Created:** [December 3, 2021, 4:46am UTC](https://community.auth0.com/t/post-registration-hook-post-request/74170 "2021-12-03T04:46:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerryforcode](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jerryforcode/32/32084_2.png) [@jerryforcode](https://community.auth0.com/u/jerryforcode)\
**Post date:** [December 3, 2021, 4:46am UTC](https://community.auth0.com/t/post-registration-hook-post-request/74170/1 "2021-12-03T04:46:56Z")

</div>

Hi,

I’d like to post a request to my express api to pass in the user metadata to an api endpoint and have that essentially posted to the database. I am wondering how this works from auth0:  
A user registers to my app in frontend, the post register hook gets called… but how can i pass this info along? … In addition, I am planning on configuring my rest express api to also authenticate as well.

Please advise.

Thank you!

---

<div class="post-metadata">

**Author:** ![jerryforcode](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jerryforcode/32/32084_2.png) [@jerryforcode](https://community.auth0.com/u/jerryforcode)\
**Post date:** [December 6, 2021, 8:39pm UTC](https://community.auth0.com/t/post-registration-hook-post-request/74170/2 "2021-12-06T20:39:54Z")

</div>

@SaqibHussain @konrad.sopala  
Would appreciate any help for this.  
Thank you!

---

<div class="post-metadata">

**Author:** ![SaqibHussain](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/saqibhussain/32/42924_2.png) [@SaqibHussain](https://community.auth0.com/u/SaqibHussain)\
**Post date:** [December 7, 2021, 7:45am UTC](https://community.auth0.com/t/post-registration-hook-post-request/74170/3 "2021-12-07T07:45:33Z")

</div>

Hey @jerryforcode

Thanks for getting in touch with us at Community 🙂

To get the user\_metadata you’ll need to create a rule to add the metadata to the id\_token as a custom claim, then it will become available in the user profile, please see [https://auth0.com/docs/configure/apis/scopes/sample-use-cases-scopes-and-claims#add-custom-claims-to-a-token](https://auth0.com/docs/configure/apis/scopes/sample-use-cases-scopes-and-claims#add-custom-claims-to-a-token)

To authenticate in your express rest api please review [https://auth0.com/docs/quickstart/backend/nodejs](https://auth0.com/docs/quickstart/backend/nodejs) in the first instance.

Let me know if you need any further info on this.

Regards

---

<div class="post-metadata">

**Author:** ![jerryforcode](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jerryforcode/32/32084_2.png) [@jerryforcode](https://community.auth0.com/u/jerryforcode)\
**Post date:** [December 7, 2021, 2:12pm UTC](https://community.auth0.com/t/post-registration-hook-post-request/74170/4 "2021-12-07T14:12:04Z")

</div>

Hi @SaqibHussain,

This information is helpful however how does this look like in the hook?

I want to do a post request so I’m assuming

Something like

var request = require(‘request’);

request({  
method: ‘POST’,  
url: ‘my\_rest\_endpoint\_url is here’,  
headers: {  
‘Content-Type’: ‘application/json’,  
},  
body: `{ "firstname": "${user.username}", "username": "${user.id}”}`  
}, function(error, response, body) {  
console.log(user)  
console.log(context)  
cb(error, response)  
});

How do I pass the token so that my express api can I identify it?

Please advise

Thanks!

---

<div class="post-metadata">

**Author:** ![SaqibHussain](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/saqibhussain/32/42924_2.png) [@SaqibHussain](https://community.auth0.com/u/SaqibHussain)\
**Post date:** [December 9, 2021, 7:39am UTC](https://community.auth0.com/t/post-registration-hook-post-request/74170/5 "2021-12-09T07:39:39Z")

</div>

Hey @jerryforcode  
I think you have this information now, please let me know if you still need help with it.  
Regards

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 22, 2021, 2:37pm UTC](https://community.auth0.com/t/post-registration-hook-post-request/74170/6 "2021-12-22T14:37:33Z")

</div>


