Retrieve deleted deals/companies/contacts

Hello,

We are currently extracting data from HubSpot through Airbyte, but we are facing the challenge of identifying when an entity, such as a deal, has been deleted, since the Airbyte connector with the HubSpot API only returns entities that have been created or updated.

Currently, to track deleted entities, we perform a weekly snapshot and use an anti-join to identify deleted IDs. However, we have entities such as Contacts or Companies with millions of records, and the snapshot process takes more than 20 hours and is very resource-intensive.

For deals, for example, Airbyte provides a stream called archived_deals, which is supposed to represent deals in the recycle bin (deleted deals that are within the 90-day period before permanent deletion). However, this stream returns fewer deals than what we see in the recycle bin on HubSpot, so it does not appear to be useful for us. Is there a reason why the API does not return the same number of deals as those visible in the recycle bin?

Additionally, we have read that it is possible to capture deletion events via a webhook, but this involves significant development and maintenance effort. Is there any other way to achieve this currently?

Thank you.

Hi @DAgoizBadia and welcome, we are so glad to have you here!
Great question, thanks for asking the HubSpot Community!
Here is some documentation “Webhooks API” that might be of interest.
I’ve found for you similar posts that might point you to the right direction:
- The solution from my colleague Jaycee on this post “Archived deals - deleted or different”
- The solution from @GRajput on this post “Issue with deleted deals post 90 days”
I’d love to put you in touch with our Top Experts: Hi @Anton, @sylvain_tirreau and @mangelet do you have suggestions to help @DAgoizBadia, please?
Have a lovely day and thanks so much in advance for your help!
Bérangère

Hello,

I can’t answer your question. I think you should explain your use case here: HubSpot Developer Feedback Form

If you have development resources (create a Python/NodeJs/PHP/Ruby script accessible via a server at a URL you specify), it’s relatively simple to create a private Hubspot application that will subscribe to deletion events (deal.deletion, contact.deletion, etc.) and then use that to perform the processing you want on your other system. To summarize, you create a listener on deal.deletion, and each time a deal is deleted it sends the deleted deal to your url which contains the script that will process the deleted deal.