Using the API I’ve downloaded all the company records for a client.
I’ve also downloaded all the users (via the UI) for that same client. I included inactive users.
If I check a couple of sample companies in the UI I can see that they have valid owner.
If I check my downloaded list of owners, I can see the name of the owner in my list.
I am using Python, the official HS Python package, and SQL
But here is the issue. The ID of the owner (hubspot_owner_id) stored against the company record does not match the ID of the user that I have in my list of users (and I can also see it’s the same ID as is in my list of users if I look up the user through the UI and look at the URL). What am I missing here?
You need to pull the Owners object data to get the actual Owner Ids.
Owners object
id: the ID of the owner. This value should be used when retrieving information about a specific owner, and when assigning an owner to a record or activity.
userId: the ID of the user. This value can be used to specify users in the settings API, but will result in an error if it is used to assign ownership.
At some point, Hubspot introduced an Owners object which changed how the hubspot_owner_id/user field worked. It no longer pulls directly from the User object. If you had records before they introduced this change, your Owner Id and User Id would be the same. Unfortunately, it’s not really well documented that this is how it works now and the UI makes it seem like it still points to the User object.