Beta feature
With performance tests, you can simulate user traffic and observe how your API behaves under load, identifying potential issues that affect performance. You can use the Postman CLI to trigger performance tests for specified collections, all within your CI/CD pipeline. Your team can use your tests to automatically catch performance issues during the deployment process. Depending on whether the performance test passes or fails, you can push or roll back your changes.
With the postman performance run command, you can configure a performance test for a collection. Add the command into your CI/CD script to integrate performance tests into your workflow. Postman recommends replacing your collection ID and API key with variables.
The Postman CLI triggers the performance test using the postman performance run command. The performance test runs against the specified collection according to your performance test configuration. Then the Postman CLI makes the test results available in the performance test results in Postman.
Performance tests aren’t supported with the Postman web app.
Use the following Postman CLI commands to configure your CI/CD script to run performance tests.
Use the command to install the Postman CLI. You can use the following command to install the Postman CLI using npm:
npm install -g postman-cli
Use the command to sign in to Postman with the --with-api-key option to authenticate using your Postman API key. You can use the following command to sign in and authenticate using your Postman API key:
postman login --with-api-key <postman-api-key>
Use the command to run a performance test for a specific collection using its ID. Configure the performance test using its supported options to specify the number of virtual users to simulate, pass or fail conditions, and more. You can use the following command to run a performance test using the default settings:
postman performance run <collection-id>
To get a collection ID in Postman, click Collections in the sidebar and select a collection. Then click Info in the right sidebar to view or copy the collection ID.
Paste the Postman CLI installation, login, and performance commands into your CI/CD script. This process depends on your CI tool.
The following example shows how to add the Postman CLI commands to GitHub Actions:
name: Run performance tests using the Postman CLI
on: push
jobs:
automated-api-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Postman CLI
run: npm install -g postman-cli
- name: Login to Postman CLI
run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }}
- name: Run performance test
run: postman performance run ${{ vars.COLLECTION_ID }}
Last modified: 2025/12/19