We’re trying to use /crm/v3/objects/companies/merge to merge multiple companies into a single one.
The merge of the first company into the primary company succeeds:
curl --request POST \
--url https://api.hubapi.com/crm/v3/objects/companies/merge \
--header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'content-type: application/json' \
--data '{
"objectIdToMerge": "111111",
"primaryObjectId": "123456"
}'
However, we then try to merge the second company into the primary company as well:
curl --request POST \
--url https://api.hubapi.com/crm/v3/objects/companies/merge \
--header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'content-type: application/json' \
--data '{
"objectIdToMerge": "222222",
"primaryObjectId": "123456"
}'
This is when we receive an error code 400 response:
{"status":"error","message":"Cannot merge ObjectCoordinates{portalId=xxxxxxx, objectTypeId=ObjectTypeId{legacyObjectType (truncated...)
Is there a restriction regarding the number of companies that can be merged into a single one? I couldn’t find any information regarding such limitations and the error message is not exactly explanatory. I tried switching around the primary and secondary id, as well as using the last secondary id as the new primary id on each iteration, with no success.