So I had a similar issue, and couldn’t find a good solution. In the end I just accepted the Webhook response as a String and then used JSON.parse()
to turn it into an object, and then tried to validate that it matches the expected interface before handing it off to the ‘real’ function.
It’s frustrating. Additionally, this run-time validation of if an object matches an interface definition is surprisingly tricky (at least for my limited Type/JavaScript skills), given TS’s focus on types, but apparently it’s not something the TS is going to support so you have to do it yourself, but this SO answer on user defined type guards answered it.