For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Postman
PricingEnterprise
Contact SalesSign InSign Up for Free
HomeDocs
HomeDocs
      • Overview
      • Schemas
        • Overview
        • Collection Runner
        • Automate collection runs
        • View scheduled collection runs
        • Run collection with simulated failures
        • Schedule collection runs with monitors
        • Trigger collection runs
        • Customize collection run order
        • Run a collection with imported data
Postman API Platform

Product

  • Postman Overview
  • Enterprise
  • Spec Hub
  • Flows
  • Agent Mode
  • API Catalog
  • Fern
  • Postman CLI
  • Integrations
  • Workspaces
  • Plans and pricing

API Network

  • App Security
  • Artificial Intelligence
  • Communication
  • Data Analytics
  • Database
  • Developer Productivity
  • DevOps
  • Ecommerce
  • eSignature
  • Financial Services
  • Payments
  • Travel

Resources

  • Postman Docs
  • Academy
  • Community
  • Templates
  • Intergalactic
  • Videos
  • MCP Servers

Legal and Security

  • Legal Terms Hub
  • Terms of Service
  • Postman Product Terms
  • Security
  • Website Terms of Use

Company

  • About
  • Careers and culture
  • Contact us
  • Partner program
  • Customer stories
  • Student programs
  • Press and media
Twitter iconLinkedIn iconGithub iconYouTube iconInstagram iconDiscord icon
Download Postman
Privacy Policy

© 2026 Postman, Inc.

On this page
  • Create a webhook
  • Access the request body in scripts
  • Send output to another API
Postman CollectionsRun collections

Trigger collection runs using webhooks

||View as Markdown|
Was this page helpful?
Previous

Automate collection runs using Postman Monitors

Next

Customize request order in a collection run

Built with

A webhook provides a way to automatically send data from one application to another. Using the Postman API’s POST /webhooks endpoint, you can create a webhook for a collection. This creates a monitor that runs the collection when the webhook is triggered at a specific time or when an event occurs.

You can also send a custom payload to the webhook, and Postman can access the data when the collection runs. This means you can run a collection without an environment, and instead rely on the data sent to the webhook.

Create a webhook

With a collection webhook, data is sent to the webhook URL using a POST request when certain events are triggered. You must configure the application that sends the data and the trigger events. Webhooks for a collection must be created using the Postman API. Learn how to use the Postman API to create a webhook.

To access the data sent to the webhook, use the pm.globals.get method with the previousRequest global variable. Using scripts, you can parse that data and use it during the collection run in any way possible.

Access the request body in scripts

When you trigger the webhook, the previousRequest global variable is temporarily created, and its value is the request body of the webhook as a JSON string. Use the pm.globals.get('previousRequest') method to get the request body of the webhook, then parse it using JSON.parse(). The data sent to the webhook is available in the data parameter inside the parsed object, as shown in the following example code:

1var previousRequest = JSON.parse(pm.globals.get('previousRequest'));
2
3var webhookRequestData = previousRequest.data;
4
5// webhookRequestData contains the data sent to your webhook.
6console.log(JSON.stringify(webhookRequestData));

The request body sent to the webhook must use JSON format.

When you create a webhook using the Postman API, a monitor is created for the webhook. You must trigger the webhook in a separate request to run the example code using the monitor. Then you can view the monitor run details that were logged to Console. To learn more about monitor results, see View monitor results.

Send output to another API

Use the data that’s sent to the collection webhook to define logic and trigger another API. For example, you might set up a webhook for your GitHub repository. Based on the updates happening in your repository, you can use the webhook to run custom build pipelines or perform CI tests.