# User id vs owner id

**URL:** <https://community.hubspot.com/t/user-id-vs-owner-id/11800>\
**Category:** APIs & Integrations\
**Created:** [March 1, 2018, 9:22pm UTC](https://community.hubspot.com/t/user-id-vs-owner-id/11800 "2018-03-01T21:22:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [March 1, 2018, 9:22pm UTC](https://community.hubspot.com/t/user-id-vs-owner-id/11800/1 "2018-03-01T21:22:10Z")

</div>

when I get the token information I get the following information: [https://api.hubapi.com/oauth/v1/access-tokens](https://api.hubapi.com/oauth/v1/access-tokens)

“user\_id”: 627388

when I lookup a deal using the REST API: [https://api.hubapi.com/deals/v1/deal/260158844](https://api.hubapi.com/deals/v1/deal/260158844)

“hubspot\_owner\_id”: {  
“versions”: [  
{  
“name”: “hubspot\_owner\_id”,  
“value”: “66”

How do I link the 2 together, is there way to use the user id and get the owner id or use the owner id and get the user id? please help, as we trying to launch our software and we are stuck.  
thanks

-Dileepa

---

<div class="post-metadata">

**Author:** ![3PETE](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/3pete/32/61905_2.png) [@3PETE](https://community.hubspot.com/u/3PETE)\
**Post date:** [March 1, 2018, 9:25pm UTC](https://community.hubspot.com/t/user-id-vs-owner-id/11800/2 "2018-03-01T21:25:31Z")

</div>

[@Dileepa\_Wijayanayake](https://community.hubspot.com/u/dileepa_wijayanayake) At the moment there is not a way to do this. I would be curious to hear why you would be trying to sync up the user that installed the app into the portal and the owner of a deal?

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [March 1, 2018, 9:48pm UTC](https://community.hubspot.com/t/user-id-vs-owner-id/11800/3 "2018-03-01T21:48:28Z")

</div>

so here’s what happens in order:  
-user authenticates, gets token, we record the user, i mean the user\_id value in our side  
-in our software user\_id maps to our user some GUID  
-when a deal is created, we get the owner id and try to look for that user in our software, and we cannot find the user

Maybe what we need to do is, instead of storing user\_id, maybe we should store owner\_id mapping to our user. but need to know how to take the user id and convert that to owner id?

The reason for above is, if the user who auths/gets the token, creates a new deal, we need to find that user who created the deal in our software. Thanks

-Dileepa

---

<div class="post-metadata">

**Author:** ![3PETE](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/3pete/32/61905_2.png) [@3PETE](https://community.hubspot.com/u/3PETE)\
**Post date:** [March 2, 2018, 3:06pm UTC](https://community.hubspot.com/t/user-id-vs-owner-id/11800/4 "2018-03-02T15:06:01Z")

</div>

[@Dileepa\_Wijayanayake](https://community.hubspot.com/u/dileepa_wijayanayake) What about the case where someone creates a deal and did not auth/gets the token? Do you log that too somehow? If so how?

You could also associate user\_id to owner\_id by the email address. Both endpoints return the email address of the user.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [March 2, 2018, 10:18pm UTC](https://community.hubspot.com/t/user-id-vs-owner-id/11800/5 "2018-03-02T22:18:11Z")

</div>

We ended up getting the owner list and finding the user from that. there was no direct api call to get a user using the owner id or the remote id.

---

<div class="post-metadata">

**Author:** ![ClydeJCC](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/clydejcc/32/29892_2.png) [@ClydeJCC](https://community.hubspot.com/u/ClydeJCC)\
**Post date:** [August 27, 2021, 5:04am UTC](https://community.hubspot.com/t/user-id-vs-owner-id/11800/6 "2021-08-27T05:04:59Z")

</div>

I faced the same scenario and found that Hubspot have a new owner api which solved the problem for me.

How I did it was, once I got the user\_id using the access token I use the /crm/v3/owners/{ownerId} endpoint with the idProperty set to userId as explained in [https://developers.hubspot.com/docs/api/crm/owners?\_ga=2.185499241.179858301.1629793963-62403396.1615546575](https://developers.hubspot.com/docs/api/crm/owners?_ga=2.185499241.179858301.1629793963-62403396.1615546575). The ‘id’ in the response is the ownerId. It worked for me.

Hope that helps.
