Glossary · Product

Payload transform

Per-webhook JSONPath extraction or Handlebars JSON template applied before dispatch.

A payload transform reshapes the inbound event payload into the shape the destination expects, applied between ingest and dispatch. Hooksbase supports two transform modes per webhook:

  • JSONPath extraction — pull specific fields out of the payload using JSONPath syntax
  • Handlebars JSON template — render a template with the payload as the template context

Transforms are available starting on the Starter tier.

When to use which

JSONPath is right when you want to pass through a subset of the payload — extract data.object.id, data.object.amount, drop everything else. Simple, fast, predictable.

Handlebars is right when the destination needs a different JSON shape — flatten a nested structure, rename fields, or build a Slack/Discord embed JSON from the source event. Hooksbase v1 supports simple path interpolation plus the json helper; it does not run arbitrary JavaScript or custom helper functions.

How transforms interact with replay

This is the part most webhook systems get wrong. If you re-transform on every replay using the current config, replays of past failures produce different outputs than the originals — because the transform changed in the meantime.

Hooksbase persists a dispatch snapshot per delivery — the transformed payload at the moment of original dispatch. Replays use the snapshot, not the current config plus raw payload. This makes replay deterministic across config changes.

Routing happens before the transform

Routing rules evaluate against the source payload, not the transformed one. This is intentional: routing should decide where the original event goes before the selected delivery payload is reshaped for dispatch.

For the broader pattern: Routing, transforms, and replay for AI agents.

Related terms