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.
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.
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.
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
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.
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.