Short answer
A connector decides which HubSpot record to update from an external ID. When two companies carry the same ID, the connector has two targets and no rule for choosing, so contacts, deals, and activity can split across them. Group companies by the ID, sort the groups into three buckets, merge only the safe bucket, and fix the cause for the rest. Check which record is the primary before you merge, because the primary's property values are kept.
1. What goes wrong
A sync that writes to a company property matches on that property. If two company records hold the same value, the sync cannot tell which one is right. Half the history can end up on each record, and whoever opens the wrong one sees only part of the account. Duplicates often come from old imports that have no contacts, deals, or website.
2. Group first, merge later
Export companies with the connector ID property, then group by that value and keep any group with more than one record. Sort every group into one of three buckets before you touch anything:
- Bucket A, safe: identical company name, same ID, and no conflicting information. Keep the record that holds the real activity and merge the empty twin into it.
- Bucket B, needs a decision: same name and ID, but different websites on file. Merging is probably right, but someone who knows the account has to say which website is correct. Activity often answers it. Where it does not, ask the account owner.
- Bucket C, leave alone: the same ID on genuinely different organizations, such as separate locations of one business or unrelated companies that share an ID. Merging would combine different organizations.
Those are not duplicates. The ID may not be unique in the source system, or the source tracks a parent while HubSpot tracks locations. Fix that decision, or the sync will keep matching the wrong records.
3. Merge the safe bucket
Open a company, choose Actions, then Merge, or call the merge endpoint for many pairs at once. HubSpot's knowledge base says the remaining record combines activities and associations from both records, and most property values come from the primary. The secondary company's domain is added to the primary as a secondary domain. The lifecycle stage furthest down the funnel is kept.
POST https://api.hubapi.com/crm/v3/objects/companies/merge
{ "primaryObjectId": "ID_TO_KEEP", "objectIdToMerge": "ID_TO_FOLD_IN" }- Merges cannot be undone. Merge only the bucket you are sure about, and write every pair you merge to a file first.
- Take the primary from the record with the activity you want to keep, not by default from the oldest or newest record.
- Check the company count before and after, and compare it with the number of pairs you expected to merge.
- HubSpot limits merges per record. A record that has been merged many times may need a different fix. A company that is in a parent-child loop can fail to merge.
4. Send the rest back as a short table
For bucket B, a table the account owner can answer in a few minutes works: company, website on the active record, other website on file. Mark the pairs that look like different businesses so nobody merges them by reflex. Two organizations that were separate before a merger or rebrand may legitimately keep two records.
The merge screen and its steps are in the duplicates article.