Skip to content
Latchkey

How to Debug a Webhook Delivery

Start webhook debugging from the sender delivery log, then capture the raw request and log the delivery id in your handler.

Most senders keep a delivery log with the request, response, and a redeliver button. Point the hook at a request bin to see raw bytes, and log X-GitHub-Delivery so you can correlate.

Steps

  • Open the sender delivery log and read the response code and body.
  • Point the hook at a request bin to capture raw headers and body.
  • Log the delivery id in your handler to correlate with the sender.

Log the delivery id

handler.js
app.post('/webhook', (req, res) => {
  const id = req.headers['x-github-delivery'];
  const event = req.headers['x-github-event'];
  console.log(JSON.stringify({ id, event, len: req.rawBody?.length }));
  // ... verify and process
  res.status(200).end();
});

Gotchas

  • A 302 or HTML response usually means the request hit a login page, not your handler.
  • Use the sender redeliver button rather than forcing a real event to reproduce.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →