Feature: Webhook exclusion

I’ve managed to create a server and register a webhook with the Trello API, however, when my server makes a request to modify the model attached to the webhook, my server immediately receives a request from the webhook with the change my server just made. It would be nice to be able to have requests from my server to Trello be ignored or excluded if my server was the one to initiate the change.

Example:

  1. Set up custom web server
  2. web server POST to /webhooks
  3. web server POST to /cards
  4. Update card from Trello.com’s web interface

Expected:
/webhooks is successful,
/cards is successful,
update is successful,
webserver is notified of update only

Actual:
/webhooks is successful,
/cards is successful,
webserver is notified of card add,
webserver is notified of card update

Great question and a very tricky one to answer. The short answer is: no, there isn’t a way to exclude actions being sent to webhooks that were triggered by requests from your server.

I believe that the way most developers work around this is they keep some queue of recent requests from their server and when they receive a webhook, check the type and data and look through their recent requests to ensure that this action isn’t one of their own.

Seems like it could get very complicated very quickly to have to store all outbound requests to Trello until a webhook is returned. Is there an official list of webhook types and their associated data? The only one I’ve found is here: https://github.com/fiatjaf/trello-webhooks. Not sure how accurate it is since it hasn’t been updated in 9 months.

My current solution is to have make changes as a specific Trello user, then just ignore changes made by that user. Though, I’d like to move to something where changes made are done as the user making them, not some other user, which is why I need a different way to ignore requests initiated by my server.

Seems like it could get very complicated very quickly to have to store all outbound requests to Trello until a webhook is returned.

Yeah, that solution is much easier said than done.

Action types are listed here: https://developers.trello.com/reference#action-types