Mock server
Give a collection a URL that answers with your saved examples. · 3 min read
A mock server lets front-end and mobile developers work before the real API is ready.
- Save examples on your requests: send a request and press Save example, or import an OpenAPI file with examples.
- Open the collection's menu and choose Mock server, then Create mock server.
- Copy the URL and use it as the base URL in your app.

A call to <mock URL>/bills/5 finds the request in the collection with the same method and path. Variables in the path, like {{billId}} or :billId, match any value. It answers with that request's first successful saved example, including its status, headers and body.
- Send
x-mock-response-code: 404orx-mock-response-name: Not foundto get a different example. - Set a Delay to test loading states.
- Use as environment creates an environment whose
baseUrlis the mock, so you can send the collection's requests to it from Sir, Post. - Turn off stops answering; Delete mock removes the URL for good.
Anyone with the URL can call it, and browsers on any website can use it. Keep secrets out of saved examples.
Did this help? If not, ask us.
Next: Update a fork from the original →