How to set a new Primary Company to a Contact

Hello community!

I have a current Contact in my account that already has a “Primary Company”.

I want to update it to a new Company, so I’m using this endpoint:

/crm/v4/objects/contact/{objectId}/associations/company/{toObjectId}

Passing this data in the body:

[

{

associationCategory: “HUBSPOT_DEFINED”,

associationTypeId: 1,

label: “Primary”

}

]

However, the response I get from that request, says the associationTypeId used was the `279` (the default Contact To Company).

How should I proceed? Should I update the existing Primary one first?

Hey, @heytavo :waving_hand: Did you get this resolved? If not, I believe this note in the documentation answers your question – Association type IDs:

“If a record has more than one associated company, only one can be the primary company. The other associations can either be unlabeled or have custom association labels.”

You are correct in needing to update or remove the existing Primary Company association before updating a new primary company for your record.

The docs don’t tell us why it’s not possible, just that there can only be one. I understand why this would be useful.

Best,

Jaycee