Skip to main content
Transformations allow you to modify webhook properties before delivery—change the HTTP method, target URL, or payload structure. Write JavaScript code that runs on each webhook to customize how events are delivered to your endpoint.

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 a handler function that receives the webhook object and returns a modified version.

Input properties

Output properties

Return the same object with modifications. You can also set:

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:
  1. Click Test in the transformation editor
  2. Select an event type or enter a custom payload
  3. Review the transformed output
  4. Verify the URL, method, headers, and payload are correct
Canceled webhooks appear as successful deliveries in logs. Use cancel sparingly to avoid missing important events.