Reassign lead primary company

Hi,

We’re trying to re-assign an existing lead to another primary company through the api while it already has a primary company, but it doesn’t seem to work.

When the lead has a primary company and we create a new association with type id 580 (lead to primary company) through the associations api, it returns successfully created, but the lead has disappeared.

I’m assuming this has something to do with the fact that a lead is automatically removed when it has no primary and it being triggered somewhere in the API when assigning a new primary company.

Anyone any ideas or has successfully done this?

Thanks.

Hi @tim_koalify,

HubSpot allows only one primary company per lead. To change it, you usually need to remove the current primary association first, then add the new one. If you try to add a new primary without removing the existing one, the system might not update properly, or the lead could appear to be missing due to broken associations.

Here’s what you can do:

  1. Use the API to remove the current primary company association from the lead.
  2. Once removed, create a new association with the new company as the primary.

Hi @GiantFocal ,
Thank you so much for taking the time to reply!
I’ve tried your suggestion. The problem is that a lead needs to have a primary company, otherwise it is deleted. So when I remove the primary association, the lead is deleted as well and the creation of the assiciation with the other company fails.
I feel this is a shortcoming in the internal working of lead associations?
Kind Regards,
Tim.

Hi @tim_koalify, I hope that you are well!
And thanks @GiantFocal for your help!
Let’s consult with some of our Top Experts to see if they experience the same: Hi @sylvain_tirreau, @Anton and @zach_threadint do you have other suggestions to help @tim_koalify to re-assign a lead to another primary company via API, please?
Have a great day, and thank you, your contributions are highly appreciated!
Bérangère

Hi @BérangèreL ,

Thanks for chiming in. In the meantime, the HubSpot development team has confirmed this issue as a bug. When you try to reassign a company primary lead that has no associated contact, the lead disappears. They’ve added it to the roadmap to fix, but we’ll have to wait and see when they get to it.

Hi @tim_koalify, thank you so much for coming back to me and update the HubSpot Community!
This will help many other Community Members.
Hopefully this will be fixed real quick for you!
Have a lovely day @tim_koalify! :sun_with_face:
Bérangère

Is there a fix for this yet? it’s a really problematic bug for me. I need to be able to switch primary companies.

Hello @Zayne

Thanks for posting in our Community!

I’ll tag @tim_koalify here for you, but from my understanding it sounds like this still may be the case.

Going to loop in a few of our experts here in case they’ve found a way to work around this.

@GRajput, @SteveHTM, @evaldas

Do you have any suggestions for @Zayne?

Thank you!

Sam, Community Manager

It’s not yet working. Tried the same things as above. Any timeline when this will be fixed?
FYI:
1. Removing a primary associated company from a lead deletes it from the CRM.

2. Assigning a new primary associated company to a lead deletes the lead from the CRM.

3. Asssociating a company to a lead then setting tag of associated company as Primary deletes the lead from the CRM.
PLEASE FIX

I’m having the same problem since the migration. I tried the same steps mentioned above, but the issue is still happening. Hoping this can be fixed soon.

Hi @RPalanog, @DNavarro82 and thanks for sharing these details with the HubSpot Community!
According to our Leads API guide, the behavior you’ve described is expected in some cases:
“When all primary associations are removed from a lead, the lead will be deleted automatically.”
This means that a lead does need to have a primary association in order to remain active in the CRM.

However, the situations you mentioned in #2 and #3, where just updating or reassigning the primary company leads to deletion, do seem unexpected, since you’re not removing all associations.
To help our support team look into this further, I’d recommend reaching out to our Support Team. When you do, please include:

- A description of the problem (leads being deleted when primary company is changed)
- What you expected to happen (the lead remains after reassignment)
- The steps you followed (your three scenarios are perfect)
- Your Account ID and any relevant x-HubSpot-Correlation-ID headers from the API responses
- The link to this Community post
These might be unintended behaviors, and it’s great that you’ve brought them to our attention.

Your detailed feedback is really valuable, thank you for being proactive about this!
I hope that you’ll get sorted soon!
Bérangère
This post was created with the assistance of AI tools