APIs & Integrations

Solution2
Member

How do I associate a company with a contact using the API?

I am attempting to associate the contacts I created with the companies in my test environment. There is a field called “associatedcompanyid”, but it remains empty, even if I use the setting that automatically associate contacts with their companies. The “contacts at companyName” part has the user, though.

Is this field supposed to be manually filled in? is there another way to associate the contact and company?

UPDATE: Sorry, seems it takes a lot longer than I expected for the associations to be made.

0 Upvotes
1 Reply 1
Dadams
HubSpot Employee
HubSpot Employee

How do I associate a company with a contact using the API?

@Solution if you’re creating contacts via the API, you can manually populate the associatedcompanid property with the companyId of the company record that you want the contact to be associated with.

Otherwise, if you have the option to automatically associate contacts with companies, we will automatically populate that property based on the contact and company data, but it’s not going to happen instantly, so you’d need to wait a minute or so before you’d see that happen. We have more details about that feature here:

How does the 'automatically create and associate companies with contacts'...

Learn how the 'automatically associate contacts with their company based on contact email address and company domain' setting works in HubSpot.

0 Upvotes