Stopping a webhook temporarily for an API create or update transaction

I’m wondering if there is a way to stop a webhook from executing when doing an API mutation to create or update a record. I have a web application that manages database records. The records are similar to Monday.com boards where there are “items” and “subitems”. Currently, when a user uses the web application to create or update records (items or subitems), the Monday.com API is used to create and update record on a Monday.com board. I also have webhooks that push changes from Monday.com to the web application. So, when an item or subitem is updated on Monday.com, the changes are pushed to corresponding records on the web application. So if users make changes on Monday.com they also appear in the web application and if users make changes on the web application, they also appear on Monday.com.

However, this creates a situation where if a user makes a change on the web application, it get’s pushed via the API to Monday.com and then webhooks on Monday.com are executed to push the same change back to the web application. So the web application is updated twice. In other words, a user makes a change to the web application. The web application pushes the change to Monday.com via the API. Then Monday.com webhooks send the change back to the web application where it is updated again. While it works fine, it’s redundant to update the web application twice.

Is there a way when making an API mutation to create or update to stop the webhook from firing? In other words, I only want the webhook to execute when a change is made directly on the Monday board (not via an API call).

hi @dborgnino

Welcome to the community. There is no API mutation to stop or pause a webhook, you can only create and delete them. This could be a workaround if the transaction rate is really low, in that case you can delete the webhook and add it back again later. Not the best solution I guess :frowning:

Another approach is to inspect the userId of the event. If you create a dedicated user for the integration on you monday board that user will be in the event for any changes made by that integration. If the event contains another userId you can be sure that the change was initiated by a real user and not the app. For this you need the ability to inspect the webhook on the receiving side (your database?). If that is not a possibility you could write a simple app that acts as “the man in the middle” where the only task for that app is to forward event from monday ONLY if they are not initiated by the integration.

Hope that helps a bit.