Merge error: Invalid Canonical VID

Hi there,

We do a lot of merges through our plugin using the HubSpot Merge Api , but once in a full moon we get the following error when merging:

Failed to merge contacts due to INVALID_CANONICAL_VID

The portals exists, the formatting is correct and both contact ids exist when I retrieve them using the API. So I’m not sure why it sporadicalliy fails. Anybody has encountered this before?

Thanks,
Tim.

Hey @tim_koalify :waving_hand: I took that error and did some searching internally for matching support cases. Here’s what I found:

  • this can happen when a merge failed previously (not necessarily from use of your app, it could have been from a user attempt in-app or some other situation)
  • it leaves the contact in a state where merges cannot happen
  • taking it to support is the only option you’ll have to get this contact “repaired”

My suggestion for reaching out to support is to focus on the state of the contact and the error, and avoid framing it as a support issue with a third-party app.

Best,

Jaycee

Hi @Jaycee_Lewis , Thank you so much for taking the time to go through this!
A bit of a pain we’ll have to go through support everytime we encounter this, but we’ll take it! :slightly_smiling_face:

Hi @tim_koalify

The VID you’re using in the API request might be wrong. Ensure that the VID corresponds to an actual contact in HubSpot. If the contact has been deleted or merged, the VID might no longer be valid.
i think this is what is causing the problem - If the contact has been merged, the original VID may no longer be valid. Use the primary VID of the merged contact.
Before making you can use a HubSpot contact search API and if a response comes then only you should proceed with your code.

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!