Skip to navigation

Reference request metadata in scripts

View as Markdown

The pm.info object provides meta information related to the request and the script itself.

pm.info properties

The pm.info object contains the following properties:

  • pm.info.eventName:String - The script that’s running. The value depends on the request type:

    • For HTTP requests, it’s prerequest in a Pre-request script or test in a Post-response script.
    • For gRPC requests, it’s beforeInvoke in a Before invoke script, onIncomingMessage in an On message script, or afterResponse in an After response script.
    • For GraphQL requests, it’s beforeQuery in a Before query script or afterResponse in an After response script.
    • For MCP requests, it’s beforeConnect in a Before connect script, afterConnect in an After connect script, afterResponse in an After response script, or afterDisconnect in an After disconnect script. To learn more, see Write scripts and tests for MCP requests.
  • pm.info.iteration:Number - The value of the current iteration.

  • pm.info.iterationCount:Number - The total number of iterations that are scheduled to run.

  • pm.info.requestName:String - The saved name of the request running.

  • pm.info.requestId:String - A unique GUID that identifies the running request.