Create Primary Contact Association

I am not a developer, but working with a team of devs internally. We are creating Contacts in Hubspot via the API and associating them with existing Companies with the following call:

put

/crm/v3/objects/contacts/{contactId}/associations/companies/{companyId}/1

This should set the association to primary with the associationTypeId = 1.

As documented here:

However, if the Contact’s email domain does not match the one on the Company, Hubspot’s automatic association will ALSO create another Company and connect the Contact to that Company as the PRIMARY association.

We need to avoid this at all cost as we have other processes which depend on the correct associationTypeId.

Thanks in advance!

Andrew

Heyo @Lyndwode !

I would make sure that the toggle is switched off on your portal for automatically associating contacts to company based on email address. I do not recall if this is on by default or not, but this would be where I would start
Here is the knowledge base article on the topic for some light evening reading :grinning_face:

Thanks @dennisedson ! However, the customer we are working with wants this toggle enabled in general. I also suggested this to them as the first solution :slightly_smiling_face: I will run it by them again!

  1. create the contact without email address
  2. create the contact-company association
  3. add email address to the contact

Would this work?