Mock Servers in Postman allow developers to simulate APIs without a real backend. They return predefined responses, helping frontend and mobile teams continue development even when actual APIs are not ready.
A mock server is created from an existing collection. Each request in the collection must have one or more saved examples that define how the mock server responds.
Mock URL Examples Request Matching
// Example JSON response used by Postman Mock Server
{
"status": "success",
"message": "User fetched successfully",
"data": {
"id": 101,
"name": "Rahul",
"email": "rahul@example.com"
}
}
When the mock URL is called, Postman returns the above JSON response with the defined HTTP status code, headers, and body.
Click the "Send" button below to simulate calling a Postman Mock Server. It will retrieve the saved example data immediately.
Or use actual JavaScript code:
// Fetching data from a Postman Mock Server
fetch("https://mock.postman.com/users")
.then(res => res.json())
.then(data => console.log(data));