This is the reference list. For the concept and a worked example, start with
templating .
Activation
Scope How One stub "transformers": ["response-template"] on the responseWhole host Start the server with --global-response-templating Webhooks Automatic — webhook fields are templated with no transformer needed
The request model
These are data paths, not helpers — read them directly.
Path Value request.methodHTTP method request.urlFull URL including query string request.pathPath; request.path.[n] for a segment; request.path.<name> when the stub used urlPathTemplate request.pathSegments.[n]Path segment by index request.query.<name>Query parameter request.headers.<Name>Request header request.cookies.<name>Cookie request.bodyRaw body request.bodyAsBase64Body, base64-encoded request.hostrequest.portrequest.schemerequest.baseUrlrequest.parts.<name>Multipart part; has .body, .name, .headers.<H>
Named path variables such as request.path.id only resolve if the stub matched through
urlPathTemplate. See request matching .
The root object differs by context:
Context Root Response templating requestWebhook originalRequestWebSocket message mappingmessage.body
Data helpers
Helper Purpose jsonPathExtract a value from JSON with a JSONPath expression xPathExtract a value from XML with an XPath expression regexExtractExtract a capture from a string with a regex formDataRead a form-encoded body into named fields parseJsonParse a JSON string; available in inline and block form assignBind a value to a name; block form
Date helpers
Helper Purpose parseDateParse a string into an instant dateFormat an instant nowCurrent time; accepts offset= and a format pattern truncateDateTruncate an instant to a unit
Random helpers
Helper Purpose randomValueRandom value of a given type=, e.g. UUID pickRandomPick one element at random randomIntRandom integer randomDecimalRandom decimal
JSON helpers
Helper Purpose jsonArrayAddAppend to a JSON array jsonMergeMerge two JSON objects jsonRemoveRemove a node from JSON toJsonSerialize a value to JSON
Helper Purpose mathArithmetic; supports + - * / only numberFormatFormat a number sizeLength of a string or collection joinJoin a collection with a separator substringSubstring by index replaceReplace occurrences in a string upperUppercase lowerLowercase capitalizeCapitalize trimStrip surrounding whitespace base64Base64-encode urlEncodeURL-encode formatJsonPretty-print JSON formatXmlPretty-print XML isOddOdd-number test isEvenEven-number test rangeProduce a numeric range arrayBuild an array from arguments lookupRead a value out of a collection by key or index arrayAddAppend to an array
System helpers
Helper Purpose systemValueRead a system/environment value hostnameHost name of the running server
Caution
systemValue is deny-by-default . Every key renders [ERROR: Access to <key> is denied], and there
is no allowlist mechanism to open specific keys. Do not build stubs that depend on it. For values you
control, use environments instead.
Fake data
One helper, random, taking a Datafaker-style expression string:
{{ random ' Name.fullName ' }}
Class Methods NamefirstName, lastName, fullName, name, username, prefixInternetemailAddress, url, uuid, domainName, ipV4Address, macAddressAddresscity, country, countryCode, zipCode, state, stateAbbr, streetAddress, streetName, buildingNumber, secondaryAddress, fullAddress, latitude, longitudeNumberdigitCompanynameCommerceproductNameLoremword, sentencePhoneNumberphoneNumber, cellPhone
An unrecognised expression renders the literal text [ERROR: Unable to evaluate the expression <expr>]
into the response rather than failing the request.
Argument-taking faker expressions such as Number.numberBetween are not supported. Locale selection
is not supported either.
JWT helpers
Helper Purpose jwtProduce a signed JWT jwksProduce a JWKS document
Handlebars built-ins
{{#if}}, {{#each}}, {{#unless}} and {{#with}} are available as normal.
Helpers that do not exist
Several helper names appear in third-party references and even in the dashboard’s helper popup, but
are not registered in the engine. The engine is the authority.
Name Use instead addmathsubtractmathmultiplymathdividemathround— abs— soapXPathxPath