How do you get the Company owner from the companies API

SOLVE
BrianM2
Member

Hi,

 

I have extracted a list of owners, but would now like to see which owners are assigned to which companies. Is there a parameter on the companies API that will provide this information?

 

Thanks

 

 

 

0 Upvotes
1 Accepted solution

Accepted Solutions
MatthewShepherd
Solution
HubSpot Employee

Hi @BrianM2 

If you use the Get all companies endpoint of the Companies API you can include the hubspot_owner_id property in the properties parameter as follows:

 

https://api.hubapi.com/companies/v2/companies/paged?hapikey=yourapikey&properties=name&properties=hubspot_owner_id

 

You then need to match this up to a list of your Hubspot owners.

 

Edit: In reading your question again, you may be looking for a way to just pull companies with a specific owner ID. I don't see a way to do this directly through one API request.


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional

View solution in original post

8 Replies 8
MatthewShepherd
Solution
HubSpot Employee

Hi @BrianM2 

If you use the Get all companies endpoint of the Companies API you can include the hubspot_owner_id property in the properties parameter as follows:

 

https://api.hubapi.com/companies/v2/companies/paged?hapikey=yourapikey&properties=name&properties=hubspot_owner_id

 

You then need to match this up to a list of your Hubspot owners.

 

Edit: In reading your question again, you may be looking for a way to just pull companies with a specific owner ID. I don't see a way to do this directly through one API request.


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional

View solution in original post

BrianM2
Member

Thanks,

 

That's exactly what I was looking for.

0 Upvotes
MatthewShepherd
HubSpot Employee

@BrianM2 

Glad to hear it. If this answered your question, could you mark the answer above as a solution, please?


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
0 Upvotes
Dan_Potts
Member

Is there any way to include the company owner data in the companies request to avoid another request and having to pair up the data?

0 Upvotes
MatthewShepherd
HubSpot Employee

@Dan_Potts I don't believe so.

https://api.hubapi.com/companies/v2/companies/paged?hapikey=yourapikey&properties=name&properties=hubspot_owner_id

 

is returning the Hubspot owner, just not in a recognisable format (numeric ID). Hence the need to match Hubspot Owner ID to an owner name via a call to the  Hubpsot Owners Endpoint. 


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
0 Upvotes
Dan_Potts
Member

Oh I see 😕 Thanks @MatthewShepherd for the answer!

 

Do you have an open feature request for the ability to include this data in the request, either as an `includes` parameter, or by config?

0 Upvotes
MatthewShepherd
HubSpot Employee

Hi @Dan_Potts 

 

I don't see one in the ideas forum, but worth searching there to see if you can a similar feature request. If not feel free to submit your idea here: https://community.hubspot.com/t5/custom/page/page-id/ideaslandingpage


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
0 Upvotes
Dan_Potts
Member

Awesome! Will do! Thanks again @MatthewShepherd !

0 Upvotes