Transform

Data Transformation

Reshape requests and responses with TypeScript, redirect traffic to alternative resources, and apply conditional transforms with predicate-based triggers — all without changing your application code.

TypeScript Transforms

Write full TypeScript to mutate any part of a request or response — headers, body, URL, query params — before it leaves or arrives at the proxy.

Dynamic Redirects

Rewrite target URLs at runtime to redirect traffic to alternative resources, version-switch endpoints, or route based on request content.

Predicate Triggers

Transforms only fire when configurable predicates match — scope by method, path pattern, headers, body fields, JWT claims, or response conditions.

Transform

Programmable Request Transforms

Write TypeScript that runs inside the request pipeline. Modify headers, mutate the request body, change query parameters, or rewrite the target URL to redirect to an alternative resource — all before the request is forwarded upstream. The transform receives a typed request object and a proxy context, so routing and enrichment decisions can reference the deployment configuration.

Learn more in the docs
request-transform.ts
TypeScript
1export async function transform(
2 req: TransformProxyRequest,
3 ctx: TransformProxyContext
4) {
5 // Redirect v1 → v2 endpoint
6 req.url = req.url.replace(
7 '/v1/', '/v2/'
8 );
9 // Inject client correlation header
10 req.headers['x-client-id'] =
11 ctx.clientId;
12 return req;
13}
INPOST /api/v1/orders
OUTPOST /api/v2/orders

Transform

Reshape Response Payloads

Transform the upstream response before it reaches your callers. Filter sensitive fields, rename keys, add computed properties, or translate between API versions using TypeScript running inside the response pipeline. The transform receives the full upstream response — status, headers, and parsed body — and returns whatever shape your callers expect.

Learn more in the docs
response-transform.ts
UPSTREAMCALLER
{
"data"
"id"1"name""Alice""internal_score"94
"id"2"name""Bob""internal_score"71
"meta""total"2"page"1
}
remove internal_score, meta.page
rename data → users, meta.total → total

Transform

Conditional Predicate Triggers

Transforms can be scoped to fire only when their predicates match. Scope by HTTP method, path pattern, request headers, body content, JWT claims, response status, or response headers — so the right transform fires for exactly the right request. Set transformMode to 'conditional' and combine multiple checks to target as broadly or narrowly as needed.

Learn more in the docs
Predicate Conditionsconditional
method·methods:POST, PUT
path·path.pattern:^/api/v1/.*
header·x-api-version:must_exist
token·claims.role:admin|editor
Awaiting match…
Not sure where your API risk is?Free 15-question assessment aligned to OWASP, SOC 2 & ISO 27001.
Take the API Security Assessment

FAQ

Frequently Asked Questions

Enhance ISO 27001
Enhance SOC 2
Enhance GDPR
Enhance HIPAA

Add outbound API security
without changing code

Start on your own or talk to our team about improving the security of every API call you make.