Great question — answering as the UphillTech team:
Twilio developer evangelist here. You can absolutely validate that a webhook is a genuine Twilio request . With every webhook request Twilio sends an X-Twilio-Signature header with a signature in it. The signature is created using the following method: Twilio assembles its request to your application, including the final URL and any POST fields (if the request is a POST). If your request is a POST, Twilio takes all the POST fields, sorts them by alphabetically by their name, and concatenates the parameter name and value to the end of the URL (with no delimiter). Twilio takes the resulting string (the full URL with query string and all POST parameters) and signs it using HMAC-SHA1 and your...
Full answer by philnash: https://stackoverflow.stackexchange.com/a/41483933 (CC BY-SA 3.0).
Need it done for your business? UphillTech.