Payload Transforms
Reshape, filter, or enrich webhook payloads before they reach your endpoint.
The Problem
Your internal event has 50 fields, but your customer only needs 5. Or the payload format doesn't match what their system expects. You could transform on your side, but that adds complexity.
How Transforms Work
Transforms are rules that modify the payload before delivery. They run on HookSniff's side, so your endpoint receives exactly the data it needs.
Quick Start
Create a transform in 3 steps:
1. Select an Endpoint
Go to Dashboard → Transforms. Select the endpoint you want to add a transform to.
2. Define the Transform Rule
Choose the transform type: Filter (include/exclude fields), Map (rename fields), or Enrich (add fields).
3. Test and Apply
Use the test panel to verify the transform works correctly, then save.
Transform Types
🔍 Filter
Include or exclude specific fields from the payload. Use dot notation for nested fields.
Example: Exclude internal fields like _internal, debug, metadata.trace_id🔄 Map (Rename)
Rename fields to match your customer's expected format.
Example: Rename user_id → userId, created_at → createdAt➕ Enrich
Add computed or static fields to the payload.
Example: Add environment: "production", api_version: "2024-01"API Example
Create a transform rule via the API (transforms are nested under endpoints):
curl -X POST https://hooksniff-api-1046140057667.europe-west1.run.app/v1/endpoints/ENDPOINT_ID/transforms \
-H "Authorization: Bearer hr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d {{"rule": {{"filter": {{"exclude": ["_internal", "debug"]}}, "map": {{"user_id": "userId"}}, "enrich": {{"environment": "production"}}}}}}Test a Transform
Test your transform before applying it. The test panel shows the original payload and the transformed result side by side.
curl -X POST https://hooksniff-api-1046140057667.europe-west1.run.app/v1/endpoints/ENDPOINT_ID/transforms/test \
-H "Authorization: Bearer hr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d {{"payload": {{"user_id": "123", "_internal": true, "data": {{"name": "Servet"}}}}}}Use Cases
- • Field filtering — Remove internal fields before sending to customers
- • Field renaming — Match your customer's expected format
- • Data enrichment — Add computed fields
- • Payload reduction — Strip large fields to stay under size limits
Best Practices
- • Test transforms before applying — use the test panel to verify output
- • Keep transforms simple — complex rules are harder to debug
- • Use filter to reduce payload size — smaller payloads are faster
- • Document your transforms — add descriptions for future reference
FAQ
Do transforms affect performance?
Transforms add minimal latency (<1ms per rule). They run on HookSniff's server before delivery.
Can I chain multiple transforms?
Yes. Transforms are applied in order. You can create multiple rules per endpoint.
What happens if a transform fails?
If a transform fails, the original payload is delivered unchanged. Check the delivery logs for transform errors.
Further Reading
- • Schema Validation — Validate payloads against JSON Schema
- • Templates — Pre-built configurations for common use cases
- • Event Types — Define and manage event types