Open the Configuration tab on any endpoint. Changes are applied only after you click Save changes.
HTTP method
The method stored in the configuration is what the mock endpoint matches. It must be the same method consumers use; otherwise the request is not matched and returns 404.
Latency
Latency is a delay applied before the response is returned. It is applied to successful responses, validation failures, and simulated errors alike, so it is a reliable way to test loading and timeout states.
- Slider range
- 0 – 5000 ms
- Slider step
- 100 ms
- New endpoint default
- 20 ms
- HTTP header
X-Response-Latency
Error ratio
Error ratio is a percentage between 0 and 100. On each request that passes validation, QuantaAPI rolls a random number. If the roll falls under the ratio, one entry from the error pool is returned instead of the stored response.
Error pool
The pool is the list of failures that can be injected. Each entry has an error code, a status code, and an optional message. An empty pool disables simulation even if the ratio is above zero.
| ERROR CODE | STATUS | MESSAGE |
|---|---|---|
BAD_GATEWAY | 502 | Bad gateway, upstream server returned an invalid response. |
INTERNAL_SERVICE_ERROR | 500 | Internal service error, something went wrong on the server. |
GATEWAY_TIMEOUT | 504 | Gateway timeout, upstream server took too long to respond. |
TOO_MANY_REQUEST | 429 | Too many requests, please slow down and try again later. |
Status codes must be between 200 and 599. Statuses that cannot carry a body (204, 205, 304) are not allowed; an invalid value falls back to 500.
What a simulated response looks like
The injected entry does not replace your JSON body directly. Your stored response is still rendered, but {{message}}, {{status_code}}, and {{success}} are filled with the simulated values. Design the response template accordingly.
{
"ok": {{success}},
"status": {{status_code}},
"message": "{{message}}"
}