I’ve written an integration I’d like to use across multiple organizations. If an integration is installed on multiple accounts†, how can we tell which installation a given webhook event originated from?
As far as I can tell, you have to:
- Watch for an installation event
- Grab the installation ID and organization/username
- Persist these identifiers together and do a lookup based on the organization/user a webhook affects
This feels pretty brittle and overly complicated. For example, If you miss an installation event at any point, there doesn’t seem to be any way to retrieve a list of installation IDs after the fact; if an installation event webhook failed due to a networking error, or if the webhook consumer dropped the event or otherwise processed the event incorrectly, seems like the only way to fix the integration is to have the user uninstall and reinstall it. (Problem being, you likely won’t know who to tell to reinstall your integration!)
Seems like an easy way to solve this problem would be to include an
installation_id property on the webhook payload (or a header, etc.) that corresponds to the installation from which the event originated. This would make the flow of using integrations way easier; your webhook consumer wouldn’t have to track a lot of complicated state, and missed events wouldn’t be quite so catastrophic.
Am I missing something fundamental here?
† Sidenote—I can’t figure out how to install an integration I’ve listed as public on multiple accounts, but that’s a separate issue.