Response Transformer Policy Overview
A Response Transformer Policy allows you to modify API responses before they are sent back to the client. It enables transformation of response data such as headers, payload, or metadata to meet client expectations or enforce standardization.
This policy is useful for formatting responses, adding or removing headers, masking sensitive data, or adapting backend responses without modifying the backend service.
Field Reference | Description |
| A unique identifier for the policy, used across logs, dashboards, and API group configurations. Required |
| Custom labels to organize and filter the policy by environment, team, or functionality. Optional |
| Specifies the response protocols for which this policy is applied (e.g., HTTP, HTTPS). Only responses matching the selected protocols will trigger this policy. Required |
| Defines one or more transformation rules to be applied to the response. Each rule contains Operation, Location, Key, and Value. |
| Specifies the type of transformation to perform. Supported operations include: → Upsert: Adds a new field or updates it if it already exists → Remove: Deletes a field from the response → Rename: Renames an existing field → Replace: Replaces the value of an existing field Required |
| Specifies where the transformation should be applied in the response: → Header: Modify HTTP response headers → Body: Modify the response payload Required |
| Defines the field name (key) to be transformed. → For Header, this refers to the header name → For Body, this refers to the field in the response payload Required |
| Defines the value or expression to be applied during the transformation. → For Upsert/Replace, this is the new value → For Rename, this is the new key name → For Remove, this may specify the field to be removed Required |
.png&w=1920&q=75)
.png)
How It Works :
Response received from backend: The backend service processes the request and returns a response to the gateway.Policy evaluation: The response is checked against the configured protocols to determine if the policy applies.Transformation execution: Each transformation rule is applied sequentially:Headers or body fields may be added, updated, renamed, replaced, or removed
Transformations are applied based on the configured location
Modified response returned: After all transformations are applied, the updated response is sent back to the client.
Attaching a Policy to an API Group
Once a Response Transformer Policy is created, it can be attached to one or more API Groups. Multiple policies can be applied to an API Group, and their execution order can be configured by arranging them in the desired sequence.