Configure a mock response
Open your route collection
In the dashboard, navigate to Routes, select your environment, and open the route collection that contains the rule you want to configure.
Create or select a routing rule
Click Add Rule to create a new rule, or click an existing rule to edit it. Set the HTTP method and path pattern for the rule to match (for example,
POST and /api/search).Set the action to Mock
In the rule editor, set the Action to Mock. If the rule was previously set to Proxy, the toggle on the rule card also switches between the two modes — flip it to enable mocking without opening the full editor.
Enter the status code
Enter the HTTP status code GoDizzy should return. Use any valid code:
200 for success, 429 for rate-limit simulation, 500 for error scenarios, and so on.Add response headers (optional)
Provide response headers as a JSON object. Each key is a header name and each value is the header value string.
Template variables such as
{{$randomUUID}} work in header values. See the Template variables section below for the full list.Write the response body
Enter the response body as a JSON string. This is the exact payload GoDizzy returns to the caller.
Set the latency range
Enter a Min latency (ms) and Max latency (ms). GoDizzy picks a random value in that range before responding. Set both to
0 for an immediate response. See the Latency Injection guide for more detail.Template variables
Mock response bodies and headers support template placeholders that GoDizzy expands at response time. You can reference random values, timestamps, and fields from the incoming request body.Random values
Random values
| Syntax | Description | Example |
|---|---|---|
{{$randomUUID}} | RFC 4122 UUID v4, unique per response | "id": "{{$randomUUID}}" |
{{$randomInt(a,b)}} | Integer between a and b inclusive — omit quotes for a JSON number | "score": {{$randomInt(0,100)}} |
{{$randomAlphaNumeric(n)}} | n characters from A–Z, a–z, 0–9 | "token": "{{$randomAlphaNumeric(16)}}" |
{{$randomBoolean}} | true or false — omit quotes for a JSON boolean | "ok": {{$randomBoolean}} |
{{$randomHex}} | 16-character lowercase hex string | "hash": "{{$randomHex}}" |
{{$randomHex(n)}} | n-character lowercase hex (1–256) | "hash": "{{$randomHex(32)}}" |
Time and date
Time and date
| Syntax | Description | Example |
|---|---|---|
{{$isoTimestamp}} | UTC instant in ISO 8601 format — use inside string quotes | "at": "{{$isoTimestamp}}" |
{{$date}} | YYYY-MM-DD in UTC — use inside string quotes | "day": "{{$date}}" |
{{$unixSeconds}} | Seconds since Unix epoch — omit quotes for a JSON number | "created": {{$unixSeconds}} |
{{$unixMs}} | Milliseconds since Unix epoch — omit quotes for a JSON number | "ts": {{$unixMs}} |
Request body fields
Request body fields
{{$reqBody['key']}} expands to the value of a top-level field in the incoming JSON body. A missing key or a non-JSON body expands to JSON null.Switching between mock and proxy
You do not need to open the rule editor to switch a rule’s behavior. Each rule card has a toggle in the rule list view:- Toggle on (Mock) — GoDizzy returns the configured mock response.
- Toggle off (Proxy) — GoDizzy forwards the request to the collection’s target endpoint.
Version history and rollback
Every time you save changes to a mock response, GoDizzy creates a new immutable version. Your previous configuration is never overwritten.Open version history
On the rule detail page, click View History. The history panel lists every version with the timestamp and the email address of the team member who made the change.
Inspect a prior version
Click any version to view its full configuration: status code, headers, body, and latency range.
Example: simulating a rate-limited response
429 and configure a latency range of 200–800 ms to simulate a realistic throttled API response your agent needs to handle gracefully.