After setting up a mock server, you can begin making calls to its URL. When you send a request to a mock server, the mock server sends back a response based on an example with the same path and method. You can provide multiple examples, and Postman returns the one that best matches your request.
If you configured a delay for your mock server, Postman waits the specified period of time before sending the response.
If you save the URL of a mock server to a variable, you can reference it across requests. For example, if you have a production server and a mock server, you can have an environment for each server. In each environment, create a variable with the same name (for example, {{url}}
) for the mock URL. By using the variable in your requests, you can switch between the two environments to call the production server or the mock server.
Your Postman plan gives you a limited number of free mock server calls per month. Learn more about resource usage in Postman.
To make a call to a mock server, do the following:
Click Mock servers in the sidebar, select the server, and click Copy URL.
Open a new collection request (or edit the address in an existing request), then add the mock server's URL. The URL includes the mock server's ID and the path to the request you want to mock. For example, https://4bb57fc2-219e-421e-86b4-4ffda6bf1b3b.mock.pstmn.io/get
.
Make sure the request you want to mock has at least one saved example. Learn more about adding examples to a request.
If your mock server is private, add your Postman API key to the request as an x-api-key
header. See Make calls to a private mock server to learn more.
Click Send to send the request.
To make calls to a private mock server, you need to add a Postman API key in the request header when sending requests to the mock server (for example, x-api-key:<Your-Postman-API-key>
). If you share the collection, others can use their Postman API keys to make calls to the mock server.
In addition to using Postman to call mock endpoints, you can also make requests to a mock server using a web browser.
A web browser makes a cross-origin HTTP request when it requests a resource from a domain, protocol, or port that's different from its own. Cross-Origin Resource Sharing (CORS) is a standard that defines a way in which a browser and server can interact securely. In this case, CORS refers to how a web browser interacts with the mock endpoints hosted on the Postman mock server.
CORS is enabled for Postman mock servers, so you can stub your web apps with mocked data using the mock endpoints. Development or production web apps can then make requests to your Postman mock endpoint and receive example responses.
You can view and search the details of calls to your mock servers using the mock call log. To view the call log, click Mock servers in the sidebar and select a mock server.
The call log displays a list of calls made to the mock server URL. Each entry shows the time the request was sent, the request method and path, and a response overview.
With mock server call logs, you can:
You can use the mock call log to troubleshoot your requests to mock servers.
If No matching requests
displays in the Response column, this might mean there's a problem with your mock server configuration. Make sure there's an example saved for the request in the collection you're mocking.
In the case of a service outage, you will get an HTTP 502, 503, or 504 response. Check the Postman status page for updates.
Last modified: 2025/06/16