1) Open the REST generator
Sign in, then open Generate REST Mock. You’ll see a form with fields for path, methods, headers, and response JSON.
2) Choose an endpoint path
Enter the path your mock should respond to, for example /api/users or /v1/orders. Avoid spaces and keep it URL‑friendly. This becomes part of the final URL you’ll call.
/demo/ or /sandbox/ to keep your routes organized.3) Select allowed methods
Pick one or more HTTP methods (e.g., GET, POST, PUT, DELETE). Calls using other methods will be rejected. If you plan to test form submissions, include POST; for reads, include GET.
4) Optional: required headers
Add header names that clients must send, such as X-Client or X-Env. If a required header is missing, the mock returns a clear error response.
5) Optional: protect with Bearer token
Enable “Protected by Bearer token” to require clients to send Authorization: Bearer <token>. On premium plans, you can view and regenerate the token from your dashboard.
6) Write the response body
Paste or craft a valid JSON object. Keep the structure close to your intended real API. If preferred, use AI to draft a first version, then edit fields and types.
7) Use dynamic variables (optional)
You can embed dynamic placeholders in your JSON that resolve at request time, e.g. {{uuid}}, {{email}}, {{timestamp}}. The engine replaces them with fresh values on each call.
8) Create the endpoint
Submit the form. You’ll get the endpoint URL and, if secured, the Bearer token or password data. Save these details for your tests.
9) Test the mock
Call the URL from your app or CLI. Include required headers and Bearer auth if enabled.
fetch('https://mockhub.ovh/your-path', {
method: 'GET',
headers: {
'X-Client': 'demo',
'Authorization': 'Bearer YOUR_TOKEN'
}
}).then(r => r.json()).then(console.log);
10) Next: scenarios (optional)
Add scenarios to simulate alternate responses, status codes, delays and error rates, then switch the active scenario to test failure modes.
Continue with: How to Add a Scenario and How to Switch Scenario.