The Postman Exporter tool allows you to export your Postman content and files to Insomnia while preserving the folder structure. In Insomnia, this imports the files into multiple projects within the same organization. Insomnia will create a project for each Postman workspace and import each workspace’s collections, environments, and global variables in the corresponding project.
First, make sure that you have set the POSTMAN_API_KEY
environment variable to your Postman API key. You can also use the --api-key
flag in your commands.
Run the following command to export and organize your Postman content:
npx organize-postman-export export
If needed, you can use the --output
flag to specify an output directory.
You will be prompted to install the package if you’re using it for the first time. Once it’s done running, you should get a response similar to this:
⚙️ Export configuration:
🔑 API Key: PMAK-68b...
📂 Output directory: postman_workspaces
🚀 Starting Postman data export...
📥 Fetching all workspaces...
🔎 Found 2 workspaces
📂 Processing workspace: My Internal Workspace
📚 Exporting 2 collections...
✅ Exported collection: API 1.postman_collection.json
✅ Exported collection: API 2.postman_collection.json
🌍 Exporting 1 environments...
✅ Exported environment: Global Environment 1.postman_environment.json
🌐 Exporting global variables...
✅ Exported global variables: globals.postman_globals.json
📂 Processing workspace: My Public Workspace
📚 Exporting 1 collections...
✅ Exported collection: API 3.postman_collection.json
🌍 Exporting 1 environments...
✅ Exported environment: Global Environment 2.postman_environment.json
❌ Postman API does not support global variables for public workspaces, please export it manually.
🎉 All data export completed!
If you have global variables in a public Postman workspace, you will have to export them manually.
This creates a postman_workspaces
directory in your working directory with the exported content and files.