Tutorial

How to Add a Scenario

Scenarios let you simulate alternate responses, delays, and error rates to test your app’s resilience.

1) Open your endpoint

From the dashboard, choose the REST endpoint you want to modify. Open the Actions menu on the card.

Dashboard Actions menu with Add Scenario
Open the Actions menu, then click Add Scenario.

2) Add a scenario

Click “Add scenario” to open the form, then fill in the fields below:

Add Scenario modal form
Modal form: Status Code, Response Body (JSON), Delay (ms), Error Rate (0–1), Scenario Name.
Tip: Use 200 with delay to simulate slow success; use 500/503 with a brief error message to test retry logic.

2b) Use AI Suggest (optional, premium)

Click AI Suggest in the modal header to auto-fill fields based on the selected status code.

Tip: After AI suggestion, review and adjust values to fit your exact test case, especially error_rate and delay_ms.

3) Activate the scenario

Use the toggle to set the active scenario. When active, the mock returns this scenario’s response (respecting delay and error rate) until you switch back.

Tip: Keep a “Success” scenario and an “Error” scenario so you can quickly flip between normal and failure flows.
Next: Switch Scenario Mock API Guide Create a Mock API