Enable Transformations
Transformations are configured per endpoint:1
Open your endpoint
Go to Dashboard → Developers → Webhooks and select an endpoint.
2
Navigate to Advanced
Click the Advanced tab.
3
Enable Transformations
Toggle Enable Transformation and click Edit to write your code.
Write a Transformation
Transformations declare ahandler function that receives the webhook object and returns a modified version.
Input properties
| Property | Type | Description |
|---|---|---|
method | string | HTTP method ("POST" or "PUT") |
url | string | Endpoint URL (can be changed) |
payload | object | Webhook payload (can be modified) |
eventType | string | Event type (read-only) |
Output properties
Return the same object with modifications. You can also set:| Property | Type | Description |
|---|---|---|
cancel | boolean | Set true to skip delivery (defaults to false) |
headers | object | Custom headers to include in the request |
Examples
Redirect to custom URL
Route webhooks to a URL specified in the payload:Add custom headers
Include authentication or tracking headers:Filter events
Cancel delivery for specific conditions:Transform payload structure
Reshape the payload to match your system’s expected format:Change HTTP method
Some systems expect PUT instead of POST:Testing Transformations
Before saving, test your transformation against sample payloads:- Click Test in the transformation editor
- Select an event type or enter a custom payload
- Review the transformed output
- Verify the URL, method, headers, and payload are correct