Simulate your API in Postman with a mock server

Use a mock server to simulate a server for your API requests without having to configure one. You can use any HTTP collection to set up a mock server. When you send a request, Postman returns a real-world response using data from your collection.

Get started with mock servers in Postman

To set up a mock server you can create a new one, create one from an existing collection, or build one from your request history.

You can only add mock servers to HTTP collections. You can't mock servers for APIs in Postman's API Builder or Spec Hub.

After setting up your mock server, you can then make calls to it from Postman or from a client application. The mock server simulates your API's behavior, so you can test your API or develop new functionality before your API is production ready.

If needed, the mock server can generate dynamic responses using variables and templates to better simulate real-world behavior.

Level up with step-by-step guides

If you need more help setting up a mock server, follow the step-by-step guide to mock your API using saved response examples. You'll learn how to add requests and examples to your collection, then use the collection to configure and use a mock server.

If you want to automate your mock servers, follow the step-by-step guide to set up mock servers using the Postman API. You'll learn how to use the Postman API to mock a collection and get the mock server URL.

Learn how Postman mock servers work

When you send a request to a mock server, Postman uses an algorithm to choose the saved example that best matches the request. The mock server then returns a response using the data in the saved example.

Dive deeper into the matching algorithm and learn how to create examples so you always get the responses you expect from the mock server.

Last modified: 2025/05/27