Contents
You set Stripe, GitHub or a Telegram bot to call your app, and nothing happens: no requests in the log, no data updates, or the service says delivery failed. A webhook is a POST request an outside service sends from the internet to a URL in your app, so the URL must be public, accept POST, and answer quickly with a 2xx code.
Start with the delivery log
- Stripe: Webhooks in the dashboard, then the event, then the response code.
- GitHub: repository settings, then Webhooks, then Recent Deliveries.
- Telegram: open
https://api.telegram.org/bot<TOKEN>/getWebhookInfoand readlast_error_message.
Then test the URL yourself:
curl -i -X POST https://example.com/api/webhook \
-H "Content-Type: application/json" -d '{"test":1}'
The most likely causes, in order
1. The URL isn’t public or isn’t https
What you see: the service has http://localhost:3000/..., an expired ngrok URL, or plain http://.
Fix: enter the final URL on your domain with https:// and make sure the certificate works. For n8n, see n8n webhook not working.
2. A 301 or 302 redirect before the app
What you see: curl -i returns 301 with a Location header. Many services don’t follow redirects, and some turn POST into GET, losing the body.
Fix: use the exact final URL: https not http, the domain with or without www the way your site redirects, and the trailing slash your framework expects. Avoid redirect loops (ERR_TOO_MANY_REDIRECTS).
3. The route is wrong or doesn’t accept POST
What you see: 404 or 405 Method Not Allowed.
Fix: define the route for POST. In Express: app.post("/api/webhook", ...); in the Next.js App Router, export a POST function from app/api/webhook/route.ts. For a Node.js or Python app on cPanel, remember the URL starts at the app’s Application URL.
4. Protection blocks the request
What you see: 403 or 419.
Fix: exempt the webhook route from CSRF protection: @csrf_exempt in Django, the CSRF exceptions list in Laravel (419 error). If the 403 comes from the firewall, see ModSecurity 403. Verify requests with the signature the service sends instead of CSRF.
5. The app receives it but fails or answers slowly
What you see: 500, a timeout, or Stripe’s No signatures found matching the expected signature.
Fix: answer 200 immediately and do long work afterwards. Stripe checks the signature against the raw body, so don’t parse it as JSON before verifying:
app.post("/api/webhook", express.raw({ type: "application/json" }), (req, res) => {
const event = stripe.webhooks.constructEvent(req.body, req.headers["stripe-signature"], secret);
res.sendStatus(200);
});
The first request after an idle period can be slower because Passenger starts the app on demand, so keep startup light.
How to confirm it’s fixed
curl returns 200, the sender’s delivery log shows success, and the request appears in your app’s log. Most services have a Resend or Redeliver button for failed events.
Prevention
- Put the final production URL in the service after every move.
- Log every webhook request with its response code.
- Answer fast and verify signatures.
On ArabyHost
On ArabyHost AI/Developer plans, Node.js and Python apps receive webhooks through Setup Node.js App and Setup Python App, with a free SSL certificate issued automatically for the domain and its subdomains. Araby AI reads the error log and explains why a request was rejected, and AI/Developer hosting lists what the plans include.
FAQ
Does a webhook URL have to be https?
In practice, yes. Many services, Telegram included, only deliver to https URLs with a valid certificate, and the data is usually private. Use a domain with SSL active.
How do I know whether the request reached the server at all?
Open the sender's delivery log: a 404, 405, 403 or 500 means it arrived and the server answered; a timeout or connection failure means it didn't. Also log a line at the very top of the handler.
The webhook worked with ngrok but not on the hosting. Why?
The service is still sending to the old ngrok URL. Update it in the service's dashboard to `https://example.com/...`, and for Telegram call setWebhook again with the new URL.