Payload Transformations

Reshape JSON payloads, inject dynamic headers, redact sensitive data, and adapt schemas before forwarding.

What is a Payload Transformation?

Third-party webhooks often contain bloated objects (100KB+) or schemas incompatible with internal microservice APIs.

Bunnylynk allows you to write lightweight transformations to reshape payloads on the edge before they hit your internal servers.

Transformation Types

1. JSON Path Extraction & Mapping

Map incoming fields to new internal property names:

{
  "transform": {
    "type": "mapping",
    "mapping": {
      "order_id": "body.data.object.id",
      "customer_email": "body.data.object.customer_details.email",
      "cents_paid": "body.data.object.amount_total",
      "currency": "body.data.object.currency"
    }
  }
}

2. Header Injection & Redaction

Inject authentication headers (e.g. internal shared secrets) or strip sensitive tracking headers before forwarding:

{
  "transform": {
    "headers": {
      "set": {
        "X-Internal-Token": "secret_internal_token_xyz",
        "X-Bunnylynk-Source": "stripe-prod"
      },
      "remove": [
        "authorization",
        "cookie"
      ]
    }
  }
}

3. PII Redaction

Automatically redact credit cards, social security numbers, or internal email addresses from stored events to meet HIPAA and GDPR compliance guidelines.

Next: Learn about Delays & Debouncing.