CI Integrations

Continuous Integration and Continuous Delivery (CI/CD) are a core component of the API development workflow. Postman integrates with popular CI tools so you can view details about API builds in the same place where you define and test your API.

After you set up CI integration, you can view the status of builds or kick off a new build, all from within Postman. In addition, with the help of Newman and the Postman API, you can run API tests created in Postman as part of your CI pipeline.

Configuring CI integration

To set up CI integration for your API, you’ll need to create an API token in your CI tool and configure your API in Postman. See the instructions for your CI tool:

Viewing build status

After you set up CI integration, status information for CI build jobs is available in Postman. For each build you can view the commit message, the branch the build ran on, the build status (success or failed), and the time the build ran.

To view build jobs, open your API and select the Test tab. The most recent jobs are listed under Recent Runs.

  • To view a build in your CI tool, hold the cursor over a build and select View build details.
  • To kick off a new build, select Run Build. Select or type a branch name, and then select Run Build.
  • To edit or delete the integration, select the three dots Three dots icon.
View CI recent runs

To view the full list of build jobs, select View All Builds. Use the dropdown list to filter the list of builds by branch or view builds for All Branches. To get the latest build status information, select Refresh.

View all CI builds

Configuring Newman for CI

Running API tests as part of your CI pipeline helps to ensure that expectations between your API producers and consumers stay in sync.

To run your API tests along with each build, first generate the required Newman configuration code in Postman. Then add the configuration code to your CI tool. After configuration, each time a CI build runs, Newman uses the Postman API to run the collections that contain your tests. You can view the results of your tests in Postman.

Before you begin, make sure you’ve already set up an integration between your API and CI tool.

To generate configuration code for Newman:

  1. Open your API and select the Test tab.
  2. Under Recent Runs, select View All Builds.
  3. Select Configure Newman.
  4. Select a Collection and Environment to run during CI builds.
  5. (Optional) Select + Add more to select additional collections to run.
  6. Select Copy to copy the Newman configuration, and then select Finish.
  7. Add the Newman configuration you copied to the build configuration file in your API repository. See the instructions for your CI tool:
Generate Newman configuration for CI

Last modified: 2021/11/01