add_postman_collection_event
Adds an event script (pre-request or test) to a Postman collection file, enabling custom automation for API testing.
Instructions
Add an event to the Postman collection
Args:
file_path: The path to the Postman collection file (string)
event: The event dictionary with keys like listen, script, etc. (dict)
Example: {
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": ["console.log('This runs before each request');"]
}
}
Returns:
The updated Postman collection data (dict)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| event | Yes |