Skip to content

Template Variables

Template variables let you insert dynamic values into your mock responses. Use {{variable}} syntax in your response body or headers — values are generated fresh on each request.

VariableOutputExample
{{$uuid}}Random UUIDf47ac10b-58cc-4372-a567-0e02b2c3d479
{{$randomInt}}Integer 0-100042
{{$randomFloat}}Float 0.00-1.000.73
{{$randomBool}}Booleantrue
{{$randomEmail}}Email address[email protected]
{{$randomName}}Full nameAlice Smith
{{$randomString}}16-char alphanumerickf82mq1xp03nzw9y
{{$timestamp}}ISO 8601 timestamp2025-06-15T14:30:00.000Z
{{$timestampUnix}}Unix seconds1750000200
{{$date}}Date2025-06-15
VariableOutputExample
{{$firstName}}First nameAlice
{{$lastName}}Last nameSmith
{{$phone}}Phone number(555) 123-4567
{{$username}}Usernamealice.smith42
{{$avatar}}Avatar URLhttps://i.pravatar.cc/150?u=abc123
VariableOutputExample
{{$street}}Street address742 Maple Ave
{{$city}}CityPortland
{{$state}}US stateOregon
{{$zip}}ZIP code97201
{{$country}}CountryUnited States
{{$latitude}}Latitude45.5231
{{$longitude}}Longitude-122.6765
VariableOutputExample
{{$word}}Single wordsynergy
{{$sentence}}SentenceThe quick service responds promptly.
{{$paragraph}}Multi-sentence paragraph(2-4 sentences)
{{$slug}}URL slugoptimize-deploy-iterate
VariableOutputExample
{{$dateISO}}Current ISO date2025-06-15T14:30:00.000Z
{{$datePast}}Random past date (within 1 year)2024-11-03T08:15:00.000Z
{{$dateFuture}}Random future date (within 1 year)2026-02-20T19:45:00.000Z
{{$time}}Time of day14:30:00
VariableOutputExample
{{$url}}URLhttps://example.com/optimize-deploy-iterate
{{$domain}}Domain nameexample.com
{{$ipv4}}IPv4 address192.168.1.42
{{$ipv6}}IPv6 address2001:0db8:85a3:0000:0000:8a2e:0370:7334
{{$color}}Hex color#a3c1f0
{{$userAgent}}Browser user agentMozilla/5.0 (Windows NT 10.0; ...)

Some generators accept parameters using colon syntax: {{$generator:arg1:arg2}}.

VariableDescriptionExample
{{$randomInt:min:max}}Integer in range{{$randomInt:1:100}}42
{{$randomFloat:min:max:decimals}}Float in range with precision{{$randomFloat:0:10:3}}7.234
{{$randomString:length}}String of custom length{{$randomString:8}}kf82mq1x
{{$oneOf:option1,option2,...}}Pick from comma-separated list{{$oneOf:active,inactive,pending}}active

All parameterized generators work without arguments too, using their defaults.

Use repeat blocks to generate arrays of dynamic data. Wrap content in {{#repeat:N}}...{{/repeat}} to produce N comma-separated copies with fresh values each iteration.

SyntaxDescription
{{#repeat:N}}...{{/repeat}}Repeat the enclosed template N times (comma-separated)
{{$index}}0-based iteration index (available inside repeat blocks)
  • Repeat blocks can be nested for arrays within objects
  • Maximum of 500 iterations per block
{
"users": [
{{#repeat:3}}
{
"id": "{{$uuid}}",
"name": "{{$randomName}}",
"email": "{{$randomEmail}}"
}
{{/repeat}}
]
}
{
"teams": [
{{#repeat:2}}
{
"teamId": {{$index}},
"name": "{{$word}}",
"members": [
{{#repeat:3}}
{
"id": "{{$uuid}}",
"role": "{{$oneOf:admin,editor,viewer}}"
}
{{/repeat}}
]
}
{{/repeat}}
]
}

Echo back parts of the incoming request:

VariableDescription
{{request.method}}HTTP method (GET, POST, …)
{{request.path}}Request path
{{request.header.Name}}Header value (case-insensitive)
{{request.query.key}}Query parameter value
{{request.body}}Raw request body
{{request.body.field}}JSON body field (dot notation, e.g. request.body.user.name)
VariableDescription
{{vars.name}}Endpoint-level variable (set by actions)
{{project.name}}Project-level variable
{{globals.name}}Account-level variable

If your endpoint path has dynamic segments like /users/:id, use {{id}} to echo the captured value:

{
"userId": "{{id}}",
"message": "Found user {{id}}"
}

A user profile endpoint returning realistic fake data:

{
"id": "{{$uuid}}",
"firstName": "{{$firstName}}",
"lastName": "{{$lastName}}",
"email": "{{$randomEmail}}",
"phone": "{{$phone}}",
"username": "{{$username}}",
"avatar": "{{$avatar}}",
"address": {
"street": "{{$street}}",
"city": "{{$city}}",
"state": "{{$state}}",
"zip": "{{$zip}}"
},
"createdAt": "{{$datePast}}",
"active": {{$randomBool}}
}

An endpoint that echoes request data alongside generated values:

{
"requestId": "{{$uuid}}",
"method": "{{request.method}}",
"path": "{{request.path}}",
"timestamp": "{{$timestamp}}",
"status": "{{$oneOf:success,pending,failed}}",
"score": {{$randomFloat:0:100:1}},
"ip": "{{$ipv4}}"
}

A list endpoint using repeat blocks to return an array of items:

{
"total": 5,
"items": [
{{#repeat:5}}
{
"id": {{$index}},
"uuid": "{{$uuid}}",
"name": "{{$randomName}}",
"email": "{{$randomEmail}}",
"status": "{{$oneOf:active,inactive,pending}}",
"createdAt": "{{$datePast}}"
}
{{/repeat}}
]
}