Skip to main content
You can create a mock server from a collection of saved response examples, from an OpenAPI spec, or as a standalone (manual) mock.
Mock Servers are in Beta. They are on by default and appear in the sidebar. To hide them, turn off Mock Server under Preferences → Beta.

Create from a collection (saved examples)

Use this path when the collection already has saved response examples.
  1. Open the collection.
  2. In the sidebar, click the + icon next to Mock Servers and enter a Name of the mock server.
  3. Select Collection as the source, pick the collection, then click Create.
  4. Every saved example becomes a mock response (method, path, status, headers, and body).
  5. Click Start Server to start the mock server on the saved port. If the port is already in use, change it under Mock Server Settings (gear icon) → Advanced settings.
Create mock server linked to a collection

Create from an OpenAPI spec

Use this path when you have an API spec in the workspace. Turn on API Spec under Preferences → Features if it is not already enabled.
  1. Load the spec under API Specs in the sidebar (if it is not already there).
  2. In the sidebar, click the + icon next to Mock Servers and enter a Name of the mock server.
  3. Select API Spec as the source, pick the spec, then click Create.
Each operation and response status becomes a mock response with bodies derived from the schema where possible. Create mock server linked to an API spec Once the mock server is created, click Start Server to start it on the saved port. If the port is already in use, change it under Mock Server Settings (gear icon) → Advanced settings.

Create a standalone (manual) mock

To add responses yourself instead of syncing from a collection or spec:
  1. In the sidebar, click the + icon next to Mock Servers.
  2. Enter a Name of the mock server.
  3. Select Standalone as the source.
  4. Optionally set Port and Response delay under Advanced settings.
  5. Click Create, then add responses from the Responses tab.
Create a standalone mock server

Where Bruno store mock servers

Mock servers are stored in the workspace at the root of the mocks folder. After creation, the mock server is saved as a .yml file.
Sample mock-server.yml file:

Next steps