APIs & Integrations

JP98
Participant

User/Owner IDs don't align

SOLVE

When we get a user from the POST /crm/v3/objects/users/search endpoint, it has an ID 1 of [ID 1 here]. When I GET /crm/v3/owners, it has an ID 2 of [ID 2 here] (makes sense that it's different, one is a user and one is an owner), but the userId on the exact same owner/person is [ID 3 here]. Doesn't match the ID 1 [ID 1 here] at all. How does this work?????

0 Upvotes
1 Accepted solution
zach_threadint
Solution
Guide

User/Owner IDs don't align

SOLVE

Hi @JP98 👋

I agree, the concept of User ID / Owner ID / CRM Record ID can be confusing. Here's how I understand it:

  1. We're working with 2 distinct HubSpot "Object Types" (albeit "special" Object Types that don't always operate in the same way as the standard CRM Object Types):
    • Owner
    • User
  2. Relevant to your described use case, a User "record" has the following ID properties:
    1. "hs_object_id" (also returned as "id" by the API, outside the "properties" object)
    2. "hubspot_owner_id"
    3. "hs_internal_user_id"

To demonstrate the relationship between these IDs, you might like to consider the following HubSpot API responses, representing the same "person" who accesses the given HubSpot portal:

// GET /crm/v3/owners
{
    "results": [
        {
            "id": "209582270", // matches "hubspot_owner_id" in subsequent example
            "email": "example@gmail.com",
            "type": "PERSON",
            "firstName": "Example",
            "lastName": "Owner",
            "userId": 9887783, // matches "hs_internal_user_id" in subsequent example
            "userIdIncludingInactive": 9887783,
            "createdAt": "2021-12-15T12:27:06.833Z",
            "updatedAt": "2022-10-14T04:26:29.590Z",
            "archived": false,
            "teams": [
                {
                    "id": "140468592",
                    "name": "Test Team 1",
                    "primary": true
                }
            ]
        }
    ]
}

// GET /crm/v3/objects/users?properties=hubspot_owner_id,hs_internal_user_id
{
    "results": [
        {
            "id": "60177263045", // this is the User's CRM Record ID (i.e. "hs_object_id")
            "properties": {
                "hs_createdate": "2021-12-15T12:27:01.825Z",
                "hs_internal_user_id": "9887783", // matches "userId" in the previous example
                "hs_lastmodifieddate": "2024-07-16T04:51:26.719Z",
                "hs_object_id": "60177263045",
                "hubspot_owner_id": "209582270" // matches "id" in the previous example
            },
            "createdAt": "2021-12-15T12:27:01.825Z",
            "updatedAt": "2024-07-16T04:51:26.719Z",
            "archived": false
        }
    ]
}

I hope this proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


View solution in original post

3 Replies 3
zach_threadint
Solution
Guide

User/Owner IDs don't align

SOLVE

Hi @JP98 👋

I agree, the concept of User ID / Owner ID / CRM Record ID can be confusing. Here's how I understand it:

  1. We're working with 2 distinct HubSpot "Object Types" (albeit "special" Object Types that don't always operate in the same way as the standard CRM Object Types):
    • Owner
    • User
  2. Relevant to your described use case, a User "record" has the following ID properties:
    1. "hs_object_id" (also returned as "id" by the API, outside the "properties" object)
    2. "hubspot_owner_id"
    3. "hs_internal_user_id"

To demonstrate the relationship between these IDs, you might like to consider the following HubSpot API responses, representing the same "person" who accesses the given HubSpot portal:

// GET /crm/v3/owners
{
    "results": [
        {
            "id": "209582270", // matches "hubspot_owner_id" in subsequent example
            "email": "example@gmail.com",
            "type": "PERSON",
            "firstName": "Example",
            "lastName": "Owner",
            "userId": 9887783, // matches "hs_internal_user_id" in subsequent example
            "userIdIncludingInactive": 9887783,
            "createdAt": "2021-12-15T12:27:06.833Z",
            "updatedAt": "2022-10-14T04:26:29.590Z",
            "archived": false,
            "teams": [
                {
                    "id": "140468592",
                    "name": "Test Team 1",
                    "primary": true
                }
            ]
        }
    ]
}

// GET /crm/v3/objects/users?properties=hubspot_owner_id,hs_internal_user_id
{
    "results": [
        {
            "id": "60177263045", // this is the User's CRM Record ID (i.e. "hs_object_id")
            "properties": {
                "hs_createdate": "2021-12-15T12:27:01.825Z",
                "hs_internal_user_id": "9887783", // matches "userId" in the previous example
                "hs_lastmodifieddate": "2024-07-16T04:51:26.719Z",
                "hs_object_id": "60177263045",
                "hubspot_owner_id": "209582270" // matches "id" in the previous example
            },
            "createdAt": "2021-12-15T12:27:01.825Z",
            "updatedAt": "2024-07-16T04:51:26.719Z",
            "archived": false
        }
    ]
}

I hope this proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


BérangèreL
Community Manager
Community Manager

User/Owner IDs don't align

SOLVE

Hi @JP98 and welcome, we are so glad to have you here! 🤗

Thanks for asking the HubSpot Community!

For information, the HubSpot Community is a public space. I have therefore edited your content for security & confidential reasons.

1. Which endpoint did you use to have the ID 3, please?
2. Which information are you trying to see?

The more info, screenshots (without sensitive/confidential information), and details you can provide, the better the Community can assist.


I'd love to put you in touch with our Top Experts: Hi @sylvain_tirreau, @zach_threadint and @Bhupendra_Kumar do you have suggestions to help @JP98, please?

Have a beautiful day and thanks so much in advance for your valuable contributions! ❤️

Kind Regards,
Bérangère


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres! !
JP98
Participant

User/Owner IDs don't align

SOLVE

The userId that is ID 3 is a property on the owner that comes in the same response as ID 2.

0 Upvotes