Public Beta: Direct engineering support available. Join Discord →
Guides
My webhook fired. Why is there no data in my database?

My webhook fired. Why is there no data in my database?

Because your handler answered before the write was durable: it returned 200, then the insert failed, timed out, went to a different database than the one you are checking, or ran in a transaction that never committed. The sender saw success and has no reason to send it again. Write first and answer second: return 200 only once the row is committed and 500 when it is not, so a sender that retries sends it again, and key the write on the event id so the resend cannot create a second row.

Answer only after the write

// Answer the sender only after the event is stored. A failed write returns 500,
// so a sender that retries sends it again; a repeated event id leaves one row.
// insertIfAbsent(id, event) resolves once the row is committed (or already existed)
export async function receiveWebhook (event, insertIfAbsent) {
  try {
    await insertIfAbsent(event.id, event)
  } catch (err) {
    return { status: 500, body: 'not stored' }
  }
  return { status: 200, body: 'stored' }
}

Find which one it was

Search your handler's logs for the event's id. No line at all means the request reached something other than this handler — see How do I know if my webhook was delivered?. A line with an error means the write failed after the answer. A line with no error means the row went somewhere: check the database the handler is configured for, not the one you expected.

When the row exists but is wrong

That is a different failure — the event arrived and was stored, and the transform or the logic after it is wrong. Your webhook returned 200. Why did nothing happen? walks the four places a webhook dies.

Seeing every attempt

Slashbin's delivery log records every attempt to your endpoint with its response code, body and timing, so a 200 your handler sent before its write failed shows up next to the event it belongs to.

Need somewhere for the next project's webhooks to land? Slashbin's Free plan takes an account, not a card.

Start Free

(opens in a new tab)

Related