I encountered an issue with the bulk API (/crm/v3/objects/contacts/batch/update) while updating contacts. When I included certain contact IDs in the bulk request body, the update for some specific contacts failed, because the IDs of these contacts were absent in the update result.
To investigate further, I used another API (/crm/v3/objects/contacts/$id) to retrieve one of these contacts. Interestingly, the API response returned a different ID. For example, the contact ID in the request was 1, but the response showed 2.
Upon further investigation, I found that both of these contacts (IDs 1 and 2) are associated with the same company ID. This raised questions about the relationship between these two contacts. To check if they were merged, I used HubSpot APIs but found no evidence suggesting a merge.
Does anyone have any insights into what might be causing this behavior?
I encountered an issue with the bulk API (/crm/v3/objects/contacts/batch/update) while updating contacts. When I included certain contact IDs in the bulk request body, the update for some specific contacts failed, because the IDs of these contacts were absent in the update result.
To investigate further, I used another API (/crm/v3/objects/contacts/$id) to retrieve one of these contacts. Interestingly, the API response returned a different ID. For example, the contact ID in the request was 1, but the response showed 2.
Upon further investigation, I found that both of these contacts (IDs 1 and 2) are associated with the same company ID. This raised questions about the relationship between these two contacts. To check if they were merged, I used HubSpot APIs but found no evidence suggesting a merge.
Does anyone have any insights into what might be causing this behavior?
Thanks
The issue occurs because the contact IDs used in the bulk update request are likely outdated or inactive due to internal HubSpot processes, such as merging or ID reassignment.
When a contact is merged, its original ID becomes inactive, and a new primary ID is assigned. This explains why the /crm/v3/objects/contacts/{id} API returns a different ID than the one used in your bulk update.
Additionally, the fact that both IDs are associated with the same company suggests they might be part of a merge, even if no direct evidence of merging is found.
To resolve this, ensure that only active contact IDs are used in the bulk request by validating each ID with the /crm/v3/objects/contacts/{id} API before updating. If the response returns a different ID, replace it with the active ID in your bulk operation to avoid failures.
Thank you, this is very helpful. From your reply, it seems we don't need these outdated or inactive contacts, so we can go ahead and mark these records as deleted in our system, right?
However, I’m not sure if deleting these contacts might cause issues if they are still being used somewhere in HubSpot. Could this potentially break any functionality? Also for this case, fetch contacts API can't return outdated or inactive records, right?