APIs & Integrations

Dor
Member

Get recently deleted contacts/companies

SOLVE

Hi,

 

Is there a way to get recently deleted contacts/companies using the REST API?

On "Get recently modified and created companies/contacts" there's an "isDeleted" filed, but seems to me it returns only isDeleted = false records.

 

Thanks,

Dor

0 Upvotes
2 Accepted solutions
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Get recently deleted contacts/companies

SOLVE

Hi @Dor,

 

I hope all is well with you 😃

 

That's a great question! And as per what Derek mentioned on a similar forum discussion here: Getting recently deleted contacts/companies is currently not possible.

 

Also, just to make sure that we're on same page, when using the get recently updated and created contacts endpoint, I'm not seeing any isDeleted field. In this case, do you mind sharing with me the request url and response body that you're getting back from the endpoint?  

 

Having said that, one other way here that you can keep track of deleted contacts/companies is to set up a webhook subscription and for this I'd love to share with you this documentation here: Webhooks API Overview.

 

 Hope this helps to clarify!

View solution in original post

0 Upvotes
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Get recently deleted contacts/companies

SOLVE

Hey @debriefconsult,

 

Thanks for sharing such a detailed use case!

 

Currently, it is not possible to retrieve deleted contacts using contact object ID via HubSpot API. The best workaround now is for your team to store both the contact email and object ID in possibly a database and implement a search function to get contact's email based on the contact object ID. 

View solution in original post

0 Upvotes
5 Replies 5
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Get recently deleted contacts/companies

SOLVE

Hi @Dor,

 

I hope all is well with you 😃

 

That's a great question! And as per what Derek mentioned on a similar forum discussion here: Getting recently deleted contacts/companies is currently not possible.

 

Also, just to make sure that we're on same page, when using the get recently updated and created contacts endpoint, I'm not seeing any isDeleted field. In this case, do you mind sharing with me the request url and response body that you're getting back from the endpoint?  

 

Having said that, one other way here that you can keep track of deleted contacts/companies is to set up a webhook subscription and for this I'd love to share with you this documentation here: Webhooks API Overview.

 

 Hope this helps to clarify!

0 Upvotes
debriefconsult
Participant

Get recently deleted contacts/companies

SOLVE

Hi Wendy!

 

My first time asking for help here in the community, thanks in advance for sharing your knowledge.

 

Hope you can help here - I'm using the Webhooks API and my app is subscribing to the Contact Delete / Contact Privacy Delete events, so I do get a JSON with some data. 

 

This JSON has the OBJECT ID, which brings me the contact's data, including e-mail address (which is the unique key for a 3rd party system that must find and exclude the same user that was deleted in Hubspot, unfortunately I`m not able to use the ObjectId to match and delete the customer).

 

However, that JSON does not give me email address (see JSON example below), and I could not find a method in the API where I can at least use the vid/objectId to get to the whole customer property (including email). It seems all properties become unaccessible once the customer record is deleted.

 

RAW BODY PROVIDED
objectId

changeFlag

changeSource

eventId

subscriptionId

portalId

appId

occurredAt

subscriptionType

attemptNumber

 

HEADERS AVAILABLE
headers__http_host
headers__http_x_request_id
headers__http_x_real_ip
headers__http_x_forwarded_for
headers__http_x_forwarded_host
headers__http_x_forwarded_port
headers__http_x_forwarded_proto
headers__http_x_scheme
headers__http_x_original_forwarded_for
headers__content_length
headers__http_accept_encoding
headers__content_type
headers__http_user_agent
headers__http_x_hubspot_signature
headers__http_x_hubspot_signature_version
headers__http_x_hubspot_timeout_millis
id

 

Thanks in advance!

Marcio

0 Upvotes
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Get recently deleted contacts/companies

SOLVE

Hey @debriefconsult,

 

Thanks for sharing such a detailed use case!

 

Currently, it is not possible to retrieve deleted contacts using contact object ID via HubSpot API. The best workaround now is for your team to store both the contact email and object ID in possibly a database and implement a search function to get contact's email based on the contact object ID. 

0 Upvotes
Anastasiia_V
Participant

Get recently deleted contacts/companies

SOLVE

Hi Wendy, can you please share API for getting recently deleted contacts/companies? Hope it was solved and option is available now

0 Upvotes
debriefconsult
Participant

Get recently deleted contacts/companies

SOLVE

Thanks Wendy!

 

Thanks a lot for both clarifying on the API limitation (so I do not get exhausted trying to make it work) and for sharing this idea which has worked so fine. I had not thought of that 'shadowing' approach which will work for propagating both deletion and unsubscribe events. 

 

Thanks a lot!

 

Marcio