- Rewrite paths - Map consumer-facing URLs to your internal API structure
- Inject headers - Add authentication tokens, API keys, or tracking headers
- Modify query parameters - Add, remove, or transform URL parameters
- Transform request bodies - Restructure payloads, add metadata, or wrap content
- Transform responses - Filter fields, restructure data, or normalize formats
- Calculate dynamic credits - Charge based on actual usage from response data
Expression Syntax
Expressions are enclosed in double curly braces:{{ }} is treated as static text. You can mix static content with multiple expressions:
Where Expressions Can Be Used
Expressions are supported in the following Target configuration fields:Context Variables
Different variables are available depending on where the expression is used.Request Variables
Available in: Path, Headers, Query, Request BodyContext Variables
Available in: All expressionsResponse Variables
Available in: Response Body, Response Headers, Dynamic CreditsRendered Request Variables
Available in: Response Body, Response Headers, Dynamic Credits TherenderedRequest object contains the transformed request that was actually sent to the target server.
Accessing Properties
Use dot notation for object properties:Functions
String Functions
Array Functions
Encoding Functions
Type Functions
Utility Functions
Hash & Random Functions
Supported hash algorithms:
md5, sha1, sha256, sha512
Date Functions
URL Functions
Component values: 1=scheme, 2=host, 3=port, 5=path, 6=query, 7=fragment
Operators
Comparison
Logical
Ternary
String Concatenation
Arithmetic
Usage Examples
Path Transformation
Prefix all requests with a version:Custom Headers
Add authentication header:Query Parameters
Default pagination:Request Body Transformation
Wrap original body:Response Body Transformation
Extract specific fields:Dynamic Credits
Use credits from response header:Limits
- Maximum template size: 200,000 characters
- Maximum expressions per template: 100
Notes
- Expressions that fail to evaluate will throw an error and the request will return a gateway error
- JSON objects and arrays in expression results are automatically serialized
- The
request.jsonandresponse.jsonvariables arenullif the body is not valid JSON - Header names are case-insensitive and normalized to lowercase
