Here is a request that a lot of production apps will answer with a cheerful 200:
curl -s -X POST https://your-api.example/webhooks/payments \ -H "Content-Type: application/json" \ -d '{"event":"payment.succeeded","amount":5000,"customer":"cus_123"}'
Enter fullscreen mode
Exit fullscreen mode
Nobody at the payment provider sent that. You did, from a laptop, with no key of any kind. If your endpoint processes it, anyone who can guess the URL can tell your app that a payment succeeded, a vehicle moved, a message was delivered or a user confirmed their email. The endpoint exists so a vendor can reach your system without logging in, which makes it a login-free door by design, and the only thing standing in that door is whatever check you wrote.
I maintain an app with two such doors, and they use two different checks. The differences between them are most of what there is to know.
The first one: a shared secret
The app's GPS server posts position updates to it.…