Unify Logo Footer.svg
API Manager
Logo
Request Transformer Policy

Request Transformer Policy

Logo

4 mins READ

Modify incoming API requests before they reach the backing resource by adding, removing, renaming, or replacing headers, query parameters, and body fields.

Overview

A Request Transformer Policy modifies incoming API requests before they reach the backing resource. Use it to add, remove, rename, or replace headers, query parameters, and body fields — for example, to inject a standard header, drop a parameter your backend doesn't expect, or adapt a client's request to the shape your automation needs, without changing the client or the backend. It is an inbound policy. To change what callers receive, use the Response Transformer Policy instead.

request_transformer-1.png
request_transformer-1.png
request_transformer.png
request_transformer.png

Field Reference

Field

Description

Policy Name *

A unique identifier used across logs, dashboards, and API group configurations.

Tags

Custom labels to organize and filter the policy by environment, team, or functionality.

Protocols

The request protocols that trigger this policy: http, https, or both. Defaults to https. A request on a protocol not selected is refused with 403.

Transformation

One or more transformation rules. Select Add Transformation to add a rule. Each rule has an Operation and a Location, plus the fields that operation needs.

Transformation Rule Fields

Sub-field

Description

Operation

Upsert — add or update a field; Remove — delete a field; Rename — rename an existing field; Replace — replace the value of an existing field.

Location

Header — modify request headers; Query Params — modify query parameters; Body — modify the request payload.

Key

For Upsert, Replace, and Remove: the field to transform — the header name, query parameter name, or body field name.

Value

For Upsert and Replace: the new value.

Old value

For Rename: the field to be renamed.

New value

For Rename: the new field name.

How It Works

  1. Request received — The gateway receives the API request.

  2. Protocol check — The request's protocol is checked against the configured protocols. A request on a protocol not selected is refused with 403.

  3. Transformation execution — Each rule is applied in sequence: headers, query parameters, or body fields are added, updated, renamed, replaced, or removed per the configured location.

  4. Modified request forwarded — After all transformations, the updated request continues to the next policy or to the backing resource.

Attaching the Policy

Policies can attach at three levels: access profile, API, and API group. They are applied in that order: access profile first, then API, then API group.

Notes

  • Transformation rules are applied in the order you define them — if rules depend on each other (e.g., rename before replace), order them deliberately.

  • Use Remove to strip headers or parameters your backend shouldn't receive.

  • Use Upsert to inject standard headers (e.g., X-API-Version) into every request without changing each client.

  • Replace changes a field only if it is already present in the request; use Upsert to add it when it is missing.

  • Test transformations against sample requests before attaching to a production group to confirm the backend receives the shape it expects.

FAQs

Can I apply multiple transformation rules in a single policy?

Yes. A single Request Transformer Policy can contain multiple transformation rules, each targeting a different header, query parameter, or body field. Rules are applied in the order they are defined.

What is the difference between Replace and Upsert?

Replace updates the value of an existing field and leaves it unchanged if the field does not exist. Upsert adds the field if it does not exist, or updates it if it does.

Can I transform headers, query parameters, and the body in the same policy?

Yes. Each transformation rule specifies its own Location (Header, Query Params, or Body), so you can mix them within a single policy.

Does the Request Transformer change the response?

No. It modifies only the incoming request before the backing resource runs. To change what callers receive, use the Response Transformer Policy.

In what order do attached policies run, and what happens if another policy rejects the request?

Policies run in a fixed order: access profile first, then API, then API group. If any inbound policy earlier in the chain rejects the request, the chain stops there and the backing resource is never invoked.