APIs & Integrations

softcialdev
Member

Help Needed: Retrieving Old Primary Record ID from Merged Contacts Using HubSpot REST API

SOLVE

Hello community!

 

When two or more contacts are merged, HubSpot creates a new RecordId and the others RecordIds are stored in 

hs_merged_object_ids property.

However, is there any endpoint available in the REST API to return what was the primary RecordId before merging them?
0 Upvotes
1 Accepted solution
BBaber
Solution
Contributor

Help Needed: Retrieving Old Primary Record ID from Merged Contacts Using HubSpot REST API

SOLVE

@softcialdev you can retrieve it via the propertiesWithHistory param using the hs_object_id company property

curl --request GET \
  --url 'https://api.hubapi.com/crm/v3/objects/companies/{companyId}?propertiesWithHistory=hs_object_id&archived=false' \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

 

View solution in original post

1 Reply 1
BBaber
Solution
Contributor

Help Needed: Retrieving Old Primary Record ID from Merged Contacts Using HubSpot REST API

SOLVE

@softcialdev you can retrieve it via the propertiesWithHistory param using the hs_object_id company property

curl --request GET \
  --url 'https://api.hubapi.com/crm/v3/objects/companies/{companyId}?propertiesWithHistory=hs_object_id&archived=false' \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN'