[REST API] 401: webhook does not belong to token

Hi Trello community,

We’ve recently seen a couple of 401 errors, especially for the POST /webhooks endpoint that return webhook does not belong to token. Any idea what this means?

Here’s a list with some occurrence timestamps:

  • 3 Mar, 2020 15:00:35 UTC
  • 4 Mar, 2020 15:00:05 UTC
  • 4 Mar, 2020 15:00:12 UTC
  • 4 Mar, 2020 15:00:13 UTC

The last occurrence happened for the Trello organization ID 5df2ac2f225253852283796a.

Our app key is decee3f6fbe0be0d7268fe00a5238f58.

Let me know if you need any more info on this.

Found this comment where this error is thrown:

Either the model doesn’t exist yet (POST), or the webhook doesn’t belong to the token

This leads me to think that you must be trying to create a webhook right after making a POST request to create the object?

Oh, this might be a good trace. Since we’re listening for new boards via a global webhook (that’s set up per organization ID), maybe it’s good to have a short delay before trying to create a webhook for this new model.

I can’t think of anything else because when the Trello integrations are created, we only set up webhooks for boards that exist in your system and are already connected in ours.

I will get back to you this week to confirm that this is the case.

Thanks for the insight!

@bcook I have gotten a bit of time to dig more into this. It turns out that we only encounter this when creating an organization-based webhook — we register it on the Trello organization ID in order to listen to board actions create/archive/restore.

The POST request for creating an object does not happen because we’re only listening to events, we don’t create anything in Trello except for card comments. For the rest we only keep boards and cards in sync with our system.

The occurrences have gotten lower lately though. We received one yesterday. So it’s basically the only error in the past 5 days, but it’s nothing consistent or something that can create a pattern to easily detect what’s causing it.

Any other ideas?