V3 API to List Contacts with Associated Company Name

I am looking for a way to list all contacts with the associated company’s name.

I can find the “Associated Company” column in HubSpot dashboard contact list table below.

However, I couldn’t find a property like this for the API.

In V3 official guide Accounts Dashboard | HubSpot there are contact association-related APIs. But those can only query the association of 1 contact at a time. I need to list all contacts with their associated company.

Thanks.

@KChan

Add a query param to your request associations=companies

https://api.hubapi.com/crm/v3/objects/contacts/?associations=companies

This should return an array of company ids

Thanks. It works!

Last question, is it possible to get the company name, instead of the id?

Thanks.

@KChan , you will need to fire a new request to get the names using the batch read endpoint:

/crm/v3/objects/companies/batch/read

@dennisedson This is helpful. But is there a way to make the object search API respect the “associations” param?
Or if it may result in performance issues the API could allow fetching specific related fields that are highly relevant (e.g. company name) which can somehow be colocated and indexed on database level.

Hi @KChan ,
You can use this api for get contacts of list.
Link :
https://legacydocs.hubspot.com/docs/methods/lists/get_list_contacts_recent
Screen shot :

For the contact association use this :
Link :

Screen shot :

Table of association defination ids.

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regards.