Skip to content
HookDeploy
On this page

Transformations

Reshape webhook payloads before forwarding with the visual editor and 23 built-in formatters.

HookDeploy’s payload transformation editor lets you modify webhook JSON before it reaches each forward destination. No code, no JSONata — just point, click, and preview.

Configure transformations per destination in Endpoint → Settings → Forward destinations → Configure transform.

Transformation modes

PassthroughAllowlist
Default behaviorForward all fieldsForward only selected fields
Best forTweaking a few fields on an otherwise complete payloadStrict PII control, analytics pipelines
Unselected fieldsIncluded unchangedDropped from output
Strip PIIToggle “Strip field” on specific pathsUncheck fields you don’t want
Static fieldsAdded on top of forwarded payloadAdded to allowlisted output

When to use passthrough

Your webhook sender sends a rich payload and you only need to rename amount to amount_usd, mask an email, or add a source field. Most fields pass through untouched.

When to use allowlist

You’re forwarding to a third-party analytics tool and want to send only event_type and amount — nothing else. Allowlist mode ensures no accidental PII leakage.

Field path syntax

Paths use dot notation to reach nested fields:

amount                    → top-level field
data.amount               → nested object
customer.email            → deeply nested
items.0.price             → first array element's price field

In the visual editor, click any field in the JSON tree to add a transform rule. The editor loads your latest captured webhook as sample data so you can preview changes live.

Formatter reference

Formatters run in the order you add them. Chain multiple formatters on one field — for example, cents_to_dollars then prefix with value "USD ".

Numeric

FormatterOptionsInput exampleOutput example
cents_to_dollars4200"$42.00"
dollars_to_cents42.004200
multiplyvalue (number)100 × 1.5150
dividevalue (number)100 ÷ 425
rounddecimals (0–10)3.141593.14
abs-4242

String

FormatterOptionsInput exampleOutput example
uppercase"hello""HELLO"
lowercase"HELLO""hello"
titlecase"hello world""Hello World"
trim" hello ""hello"
prefixvalue (string)"123" + prefix "order_""order_123"
suffixvalue (string)"123" + suffix "-v2""123-v2"
truncatemax (length)"hello world" max 5"hello"
maskshow_chars, position (start/end)"john@example.com" show 3 start"joh*************"
hash"john@example.com"SHA-256 hex digest

Date / time

FormatterOptionsInput exampleOutput example
unix_to_iso1716912060"2024-05-28T14:01:00Z"
unix_to_date1716912060"2024-05-28"
iso_to_unix"2024-05-28T14:01:00Z"1716912060

Type conversion

FormatterOptionsInput exampleOutput example
to_string42"42"
to_number"42.5"42.5
to_boolean"true"true

Value override

FormatterOptionsInput exampleOutput example
set_valuevalue (any)anyyour configured value
set_nullanynull

Static fields

Add key-value pairs that appear in every forwarded payload regardless of the source webhook. Useful for injecting tenant IDs, source labels, or schema version markers:

{
  "source": "hookdeploy",
  "tenant_id": "acme-corp"
}

Static fields appear in the live preview in green. They are merged into the transformed output after field rules are applied.

Common recipes

Strip PII before forwarding to analytics

Mode: Passthrough

  1. Load a sample webhook in the transform editor
  2. Click customer.email in the field tree
  3. Enable Strip field (PII) on the rule card
  4. Repeat for customer.phone, customer.name, etc.
  5. Save the transform

Your analytics destination receives the full event minus sensitive customer fields.

Convert Stripe amounts from cents to dollars

Mode: Passthrough

  1. Click data.object.amount (or your amount field path)
  2. Rename to amount_usd
  3. Add formatter: cents_to_dollars
  4. Preview shows "$42.00" from input 4200

See also: Stripe webhooks.

Normalize timestamp formats

Mode: Passthrough

  1. Click your Unix timestamp field (e.g. created)
  2. Add formatter: unix_to_iso
  3. Output becomes ISO 8601: "2024-05-28T14:01:00Z"

For date-only fields, use unix_to_date instead.

Add tenant context to every payload

Mode: Either

  1. Scroll to Static fields in the transform editor
  2. Add key tenant_id, value "acme-corp"
  3. Add key source, value "stripe"

Every forwarded payload includes these fields regardless of what the sender sent.

Allowlist only the fields your server needs

Mode: Allowlist

  1. Switch mode to Allowlist
  2. Check only the fields your server expects: event_type, data.id, data.amount
  3. Add formatters as needed (e.g. cents_to_dollars on data.amount)
  4. Preview confirms only selected fields appear in output

Everything else — including unexpected PII — is dropped.

Live preview

The editor runs your transformation against sample data in real time:

  • Unchanged fields — default text color
  • Transformed fields — orange/warning color
  • Static fields — green/success color
  • Removed fields — shown as comments in passthrough mode

Load your latest captured request or paste custom JSON to test against Stripe, GitHub, or any provider payload.

Plan availability

Payload transformation availability is plan-controlled. Check the current HookDeploy dashboard or pricing page for the features enabled for your organization while plan enforcement details are being reconciled.

Next steps

  • Forwarding — Multiple destinations and header injection
  • Stripe webhooks — Stripe-specific transformation example
  • REST API — Manage destinations programmatically