# Webhooks not triggering when deal is deleted

**URL:** <https://community.hubspot.com/t/webhooks-not-triggering-when-deal-is-deleted/18645>\
**Category:** APIs & Integrations\
**Tags:** object, webhooks\
**Created:** [February 7, 2020, 5:36pm UTC](https://community.hubspot.com/t/webhooks-not-triggering-when-deal-is-deleted/18645 "2020-02-07T17:36:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![caiorochap](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/caiorochap/32/43872_2.png) [@caiorochap](https://community.hubspot.com/u/caiorochap)\
**Post date:** [February 7, 2020, 5:36pm UTC](https://community.hubspot.com/t/webhooks-not-triggering-when-deal-is-deleted/18645/1 "2020-02-07T17:36:52Z")

</div>

Hi everyone.  
I’ve created an app so I can subscribe to the deal deletion event. I’ve been checking, the response I send to my endpoint is always 200 and the subscription is active. However, my database, which should have the records deleted once the event is triggered, has around 5000 records and a full request on the [get all deals API](https://developers.hubspot.com/docs/methods/deals/get-all-deals) returns 4945 records. Also, the monitoring tab on the app shows me no webhook was triggered. Can anyone tell me what could be the problem here?

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [February 7, 2020, 8:49pm UTC](https://community.hubspot.com/t/webhooks-not-triggering-when-deal-is-deleted/18645/2 "2020-02-07T20:49:04Z")

</div>

Hey @caiorochap ,

It sounds like you’ve configured the webhook details in your developer account, but have you completed the [OAuth process](https://developers.hubspot.com/docs/methods/oauth2/oauth2-overview) for your test/production account? Webhook notifications will only be sent when the app is “installed” to a portal. Specifically, the OAuth authorization flow must be completed & refresh/access tokens must be obtained. This is required even if your app isn’t doing anything except listening to webhook notificaitons.

---

<div class="post-metadata">

**Author:** ![caiorochap](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/caiorochap/32/43872_2.png) [@caiorochap](https://community.hubspot.com/u/caiorochap)\
**Post date:** [February 10, 2020, 3:26pm UTC](https://community.hubspot.com/t/webhooks-not-triggering-when-deal-is-deleted/18645/3 "2020-02-10T15:26:04Z")

</div>

Hi, [@Derek\_Gervais](https://community.hubspot.com/t5/user/viewprofilepage/user-id/142),

That is the problem indeed. However, the documentation is quite confusing. If I’m just building a webhook listener, why would I have to authenticate an user? What could simply solve the problem here?

---

<div class="post-metadata">

**Author:** ![caiorochap](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/caiorochap/32/43872_2.png) [@caiorochap](https://community.hubspot.com/u/caiorochap)\
**Post date:** [February 10, 2020, 3:47pm UTC](https://community.hubspot.com/t/webhooks-not-triggering-when-deal-is-deleted/18645/4 "2020-02-10T15:47:36Z")

</div>

Also, the tokens expire after every six hours. How would this affect my app? I’d have to refresh it manually or create a job to refresh it? Or would it be necessary only once? I’m confused.

---

<div class="post-metadata">

**Author:** ![caiorochap](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/caiorochap/32/43872_2.png) [@caiorochap](https://community.hubspot.com/u/caiorochap)\
**Post date:** [February 12, 2020, 9:11pm UTC](https://community.hubspot.com/t/webhooks-not-triggering-when-deal-is-deleted/18645/5 "2020-02-12T21:11:44Z")

</div>

hey, [@Derek\_Gervais](https://community.hubspot.com/t5/user/viewprofilepage/user-id/142).

Could you give me some help here?

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [February 14, 2020, 10:05pm UTC](https://community.hubspot.com/t/webhooks-not-triggering-when-deal-is-deleted/18645/6 "2020-02-14T22:05:28Z")

</div>

Hey @caiorochap ,

Generating accesss/refresh tokens is what completes the authentication process, which activates webhook notifications and causes the app to appear in the “Connected Apps” page, among other things. This is an artifact of how HubSpot’s OAuth implementation was originally designed; the access token expiration doesn’t have any bearing on your webhook subscriptions.

I can totally understand how this feels weird, since you’re only interested in using webhooks. I’m happy to pass your feedback along to my team to take into account as we continue to improve the OAuth process!

---

<div class="post-metadata">

**Author:** ![xmabrielos](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/xmabrielos/32/86357_2.png) [@xmabrielos](https://community.hubspot.com/u/xmabrielos)\
**Post date:** [January 19, 2021, 2:48pm UTC](https://community.hubspot.com/t/webhooks-not-triggering-when-deal-is-deleted/18645/7 "2021-01-19T14:48:19Z")

</div>

Hello Derek,

Thank you for the support.

Should the token be refreshed each time or just the first time?
