- Installation and updates
- Sending your first request
- Creating the first collection
- Navigating Postman
- Keyboard Shortcuts
- Postman account
- New button
- Troubleshooting In-app Issues
- Customizing Postman
- Find and Replace
- Troubleshooting API requests
- Debugging and logs
- Authorizing requests
- Capturing HTTP requests
- Generate code snippets
- Making SOAP requests
- Working with Tabs
- Using GraphQL
- Visualize API responses
- Intro to collections
- Creating collections
- Sharing collections
- Managing collections
- Requesting access
- Using Markdown for descriptions
- Data formats
- Working with OpenAPI
- Commenting on collections
- Version Control for Collections
- Intro to scripts
- Pre-request scripts
- Test scripts
- Test examples
- Branching and looping
- Postman Sandbox
- Postman Sandbox API reference
- Intro to collection runs
- Starting a collection run
- Using environments in collection runs
- Working with data files
- Running multiple iterations
- Building workflows
- Sharing a collection run
- Debugging a collection run
- Command line integration with Newman
- Integration with Jenkins
- Integration with Travis CI
- Newman with Docker
- Documenting your API
- Viewing documentation
- Authoring your documentation
- Publishing your docs
- Custom documentation domains
- Intro to Monitoring
- Setting up a monitor
- Viewing monitor results
- Monitoring APIs and websites
- Set up integrations to receive alerts
- Pricing for monitors
- Troubleshooting monitors
- FAQs for monitors
- Intro to mock servers
- Setting up a mock server
- Mocking with examples
- Mocking with the Postman API
- Matching algorithm
- Introduction to APIs
- Managing APIs
- Sharing APIs and managing roles
- The API Workflow
- Validating Elements Against Schema
- Versioning APIs
- Reporting FAQs
- Viewing and analyzing APIs
- Intro to Workspaces
- Creating Workspaces
- Managing Workspaces
- Using Workspaces
- Sharing collections in Workspaces for version 5
- Viewing changelogs and restoring collections
- What is Postman Pro
- Purchasing Postman Pro
- Upgrading to Postman Pro from a trial team
- Team Settings
- Changing your plan
- Managing your team
- Migrating to Postman v7
- Roles and permissions
- Intro to Enterprise
- Purchasing Postman Enterprise
- Running Postman monitors using static IPs
- Intro to SSO
- Configuring SSO for a team
- Logging in to an SSO team
- Configuring Microsoft AD FS with Postman SSO
- Setting a custom SAML in Azure AD
- Setting up custom SAML in Duo
- Setting up custom SAML in GSuite
- Setting up custom SAML in Okta
- Setting up custom SAML in Onelogin
- Setting up custom SAML in Ping Identity
- Audit logs
- Publishing API documentation
Setting up a mock server
Mock Servers in Postman let you simulate APIs. You can create mock servers from the Postman app, from the web dashboard, and using the Postman API. You will need a Postman account to set up a mock server.
Mocks in Postman are tied to a collection. Postman matches requests and generates responses for mocks from the Examples in the requests of a collection. You can create a mock server even if you don't have an existing collection.
- Creating mock servers in the web dashboard
- Using HTTP access control for a mock
- Using free mock server calls
- Editing mock servers
- Next steps
You can create a mock in several ways in the Postman app:
- Using the New button
- From the Launch screen
- Using Examples in an existing collection
The video below runs you through the steps in creating a mock server from the New button in the Postman app.
To create your mock server, click the New button in the top left of the header toolbar.
Click Mock Server in the Create New tab.
Choose whether you want to mock a new API or an existing collection. If you create a new API to mock, you will select a request method and enter the request path, response code, and response body. If you use an existing collection to mock, you will select a collection from a list of existing or team collections.
When you have selected or created the request you want to mock, click Next.
In the Set up the mock server tab, you can configure your mock server.
- Enter the name of the mock.
- Select an environment (optional).
- Check the checkbox if you want to make the mock server private.
- Check the checkbox if you want to save the mock server URL as an environment variable.
- Click Next to continue.
The number of calls made to mock servers may be limited by your Postman account. Check your usage limits.
In the Next steps tab, you will see a list of suggested next steps to maximize the effectiveness of your mock server.
Launchpad appears by default when you launch the Postman app. To create a mock server, open the Postman app, navigate to Start something new > ... View More > Create a mock server.
Follow the process outlined in the New Button section to complete the mock server setup steps.
At the bottom, you can choose whether you want the Launchpad tab to display each time you open Postman by toggling the Open Launchpad option on or off.
You can create a mock server from an existing API. Navigate to the API you'd like to add a mock server to, then click Develop. Select Add Mock Server, then choose between creating a new mock server or adding an existing one.
This will launch the Create mock server modal. Follow the process outlined in the New button section to complete the mock server setup.
You can create a mock server from an existing collection in the left sidebar. To do that, expand the collection details pane, switch over to the Mocks tab in the pane, and click Create a mock server.
This will launch the Create mock server modal. Follow the process outlined in the New Button section to complete the mock server setup steps.
If you already have mock servers created from the same collection, you will see an Add mock button instead of Create a mock server.
You can mock a single request from the History tab in the left sidebar. Hover over an entry, and click View more actions (...) to expand the dropdown menu. Choose Mock Request.
This will open the Set up the mock server modal. Pass the values outlined in the New button section. Click Create Mock Server.
This process of creating a mock server will also create a collection with the same title as the mock server. This collection will have a copy of the same request that you chose from the History sidebar. The mock server created is tied to this new collection.
You can create a mock from an existing collection from the Browse view. Click the Browse toggle button on the bottom right of the Postman app. Change to the Collections tab for the current workspace. Click the View more actions (...) button for the corresponding collection. Select Mock Collection from the dropdown.
This will open the Create mock server modal. Follow the steps to finish creating the mock server.
You can create a mock server from the Web dashboard with existing collections and environments. Login to your Postman team dashboard, and navigate to your workspace by clicking your workspace name. In the workspace dashboard, click the Mock servers tab.
Click the button to create a new mock server, and you will see the configuration screen. Set the relevant configuration.
- Enter the name of the mock.
- Select a collection to mock.
- Select a version tag of the collection to use for the mock. Leave it to CURRENT if you want to the mock server to use the latest version of your collection.
- Select an environment to use with the mock (optional).
- Select the checkbox if you want to make the mock server private.
- Click Create Mock Server to create the mock and go back to the Mock servers dashboard.
In addition to using the Postman app to make requests to mock endpoints, you can also make those requests in a 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, we are referring to how a web browser interacts with the mock endpoints hosted on the Postman server.
CORS is enabled for Postman mock servers. As a result, 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 an example response.
Your Postman account gives you a limited number of free mock server calls per month.
You can edit existing mock servers in Postman since version
7.7.0. The following properties of a mock server can be updated through the Postman app and web dashboard:
- Name of the mock server
- Version tag of the underlying collection
- Environment associated with the mock server
- Private or public status of the mock server
There are three ways to edit a mock server. You can edit from the Collection pane, through the Mock Server listing in Browse mode, or through the web dashboard of your workspace Mock Servers section.
Editing mocks in Build mode:
Editing mocks in Browse mode:
Editing mocks from the Web Dashboard:
For more information about mock servers, see the following resources: