What is a payload transform?
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 on the classic transform route.
Use Automations and Code Mode when the transform needs versioned JavaScript in the delivery path.
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.
Frequently asked questions
When should you use JSONPath rather than Handlebars?
JSONPath when you want a subset of the payload passed through — pull out a few fields and drop the rest. Handlebars when the destination needs a different JSON shape, such as flattening a nested structure or building a Slack or Discord embed. When the transform needs versioned JavaScript, use Automations and Code Mode instead.
Do routing rules see the transformed payload?
No. Rules evaluate against the source payload, before the transform runs. That is intentional: routing decides where the original event goes, and the transform then reshapes it for the destination that was selected.
What is Hooksbase?
Hooksbase is event infrastructure for AI agents. It ingests events over four channels — HTTP, email, HTML form, and scheduled cron — verifies them, routes them by rule, runs versioned Automations in the event path, and delivers them to HTTP and cloud destinations (AWS SQS, AWS EventBridge, GCP Pub/Sub, and S3-compatible storage) with retries, strict ordering, Standard Webhooks-compatible signing, deterministic replay, and a dead-letter path. It is a hosted service, runs on Cloudflare Workers, is operated at hooksbase.com, and is not affiliated with — and shares no code or ownership with — other similarly named webhook, hook, or tunnelling tools.
Related terms
- Payload
The body of an HTTP request — for webhooks, almost always JSON.
Read - Dispatch snapshot
The transformed payload at the moment of dispatch, persisted so replays remain correct under config change.
Read - Replay
Re-running a retained event with the same input — typically after fixing a bug that caused the original to fail.
Read - Provider pack
Preconfigured inbound verification for a known provider — Stripe, GitHub, Clerk, Slack, or Resend.
Read