Webhook payload drift: catch provider changes before your pipeline drops events

Validate webhook payloads loosely where they arrive and strictly where you use them, and never let a failed parse be the only copy of an event. Store the raw body first, park anything you can't parse, alert on it, fix the parser, then replay.

What payload drift looks like

Payload drift is when a provider's webhook body changes shape and your code still expects the old one. It usually shows up as one of these:

  • A field is renamed or removed, so a lookup returns nothing.
  • A type changes, such as an amount that was a string arriving as a number.
  • A new nested object appears where a flat value used to be.
  • A new event type starts arriving that your handler has never seen.
  • The provider bumps its API or webhook version and the defaults change with it.

Say a payments provider moves the customer email from the top level into a nested customer object. Your parser reads the old path, gets nothing, and the insert fails on a required column.

Why pipelines drop events quietly

The common ways drift turns into lost data:

  • The parser throws, but the handler still returns 2xx, so the sender thinks the event landed.
  • The handler returns 4xx or 5xx, the sender retries on its schedule, and after the last attempt it gives up.
  • An unknown event type falls through a switch statement and is ignored with no log line.

Catch it early

  • Pin to the provider's API or webhook version if it offers one, so changes arrive when you choose.
  • Validate with a schema that tolerates extra fields but flags missing required ones. New fields are usually harmless. Missing ones break things.
  • Count unknown event types and unknown fields, and alert when the number jumps.
  • Subscribe to the provider's changelog or developer newsletter.

A tolerant check can be this small:

javascript
const missing = REQUIRED.filter((f) => get(payload, f) === undefined);
const unknown = Object.keys(payload).filter((k) => !KNOWN.has(k));
if (unknown.length) log.warn('webhook.unknown_fields', { type, unknown });
if (missing.length) return park(event, { missing }); // keep it, don't drop it

Lose nothing when it happens

Some drift will get through anyway, so keep the original event.

  1. 1.Store the raw body and headers before you parse anything.
  2. 2.If parsing fails, park the event somewhere you can query, with the reason.
  3. 3.Fix the parser, test it against the parked events, then reprocess them.

With the raw request kept, a drift incident costs you a fix and a replay. Without it, you depend on the provider being willing to resend.

Where SolidHooks fits

SolidHooks doesn't validate payload schemas, detect drift or transform payloads. Your code decides what's valid. What it does is keep the raw copy and let you send it again.

Every inbound webhook is stored as an event with its raw body, headers and parsed payload, and events don't change once written (events). Your service gets the event as a delivery. If your parser fails, return a non-2xx and SolidHooks retries the delivery on its schedule (retries). Once the fix ships, you can retry a failed delivery for free, or replay the stored event, which creates new billable deliveries (replay). Both work only within your plan's event retention, because older events are purged nightly (plans).

Connections can filter by event type. If a source's connections list only the types you know, a new type isn't delivered and the event is stored with the status filtered. You can list those with GET /v1/events?status=filtered. Requests that fail signature verification are stored as well, marked rejected with a reason.

Replays reach your handler under a new delivery ID, so make reprocessing safe with an idempotency key from the payload. Our guides on replaying after an outage, response status codes and out-of-order webhooks cover the related cases.

FAQ