Skip to content

Template Variables

Template variables let you generate dynamic, realistic data in your mock responses. Use double curly braces: {{variableName}}.

In your response body:

{
"id": "{{uuid}}",
"name": "{{name}}",
"email": "{{email}}"
}

Each request generates fresh random data.

Access data from the incoming request:

VariableDescriptionExample
{{params.id}}Path parameter/users/{id} -> {{params.id}}
{{query.page}}Query string?page=2 -> {{query.page}}
{{body.name}}Request body fieldJSON body access
{{headers.authorization}}Request headerHeader value
HelperOutput
{{uuid}}a1b2c3d4-e5f6-7890-...
{{name}}John Smith
{{firstName}}John
{{lastName}}Smith
{{username}}jsmith42
HelperOutput
{{email}}[email protected]
{{phone}}(555) 123-4567
HelperOutput
{{address}}123 Main St
{{city}}San Francisco
{{state}}California
{{zipCode}}94102
{{country}}United States
HelperOutput
{{company}}Acme Corp
{{jobTitle}}Software Engineer
HelperOutput
{{url}}https://example.com/page
{{domain}}example.com
{{ipv4}}192.168.1.1
HelperOutput
{{date}}2026-01-15
{{timestamp}}1737043200
{{pastDate}}Date in the past
{{futureDate}}Date in the future
HelperOutput
{{number 1 100}}Random integer 1-100
{{float 0 1 2}}Random float with 2 decimals
{{boolean}}true or false
HelperOutput
{{lorem}}Lorem ipsum paragraph
{{sentence}}Random sentence
{{word}}Random word

Generate arrays of items:

[
{{#repeat 5}}
{
"id": "{{uuid}}",
"name": "{{name}}"
}{{#unless @last}},{{/unless}}
{{/repeat}}
]

Generates an array of 5 user objects.

See Template Helpers Reference for the complete list.