Find via API a deleted contact/deal/company

Hi,

I’m an integration partner and use the webhooks to be notified about contact/deal/company events.

When a contact/deal/company is deleted, I need to get details of what was deleted. How to do it via an API request, since the webhook does not contain any helpful information?

Hi, @digows.

I assume you’re referring to the fact that webhook [object].deletion notifications only include an objectId field which identifies the object (see example below)?

[
	{
		"objectId":240401,
		"changeFlag":"DELETED",
		"changeSource":"IMPORT",
		"eventId":3899575561,
		"subscriptionId":136816,
		"portalId":123456,
		"appId":98765,
		"occurredAt":1591372245506,
		"subscriptionType":"contact.deletion",
		"attemptNumber":0
	}
]

If so, the v3 CRM object APIs support an archived boolean query parameter which enables you to look up details of deleted (archived) records.

For example, the contact.deletion notification above specifies contact 240401. The following request would fetch the deleted contact’s firstname, lastname, and email:

GET
https://api.hubapi.com/crm/v3/objects/contacts/240401?archived=true&properties=firstname%2Clastname%2Cemail