Scripting API
Look up pm.* methods for variables, requests, assertions, logs, and calls from scripts.
Scripts run in a sandboxed JavaScript VM by default. The legacy Tengo engine shares the core pm.* methods for request mutation, response assertions, variables, environments, and logs. The scripting guide explains which features are specific to JavaScript.
Module imports, process access, and filesystem access are disabled; require resolves only the bundled stand-ins. Network access is disabled too, unless a request opts into pm.sendRequest. Execution is capped at 2 seconds by default — see Script timeout.
Was this page helpful?