How to Import & Export Postman Collections (2026)
Step-by-step guide for Postman collection management
Start Building with Hypereal
Access Kling, Flux, Sora, Veo & more through a single API. Free credits to start, scale to millions.
No credit card required • 100k+ developers • Enterprise ready
How to Import and Export Postman Collections (2026)
Postman collections are the standard way to organize, share, and document API requests. Whether you are sharing endpoints with your team, migrating between workspaces, backing up your work, or setting up CI/CD pipelines, knowing how to import and export collections efficiently is essential.
This guide covers every method for importing and exporting Postman collections in 2026, including the desktop app, Postman API, CLI, and common formats.
What Is a Postman Collection?
A Postman collection is a JSON file that contains a group of API requests along with their configurations:
- Request URLs, methods, headers, and bodies
- Pre-request scripts and test scripts
- Variables and authentication settings
- Folder structure and documentation
- Example responses
Collections use the .json format and follow Postman's Collection v2.1 schema.
Exporting Collections
Method 1: Export from Postman Desktop App
The simplest way to export a collection:
- Open Postman and navigate to Collections in the left sidebar
- Click the three dots (...) next to the collection name
- Select Export
- Choose the format:
- Collection v2.1 (Recommended) -- current standard
- Collection v2.0 -- older format, wider compatibility
- Click Export and choose where to save the
.jsonfile
Method 2: Export via Postman API
Use the Postman API to export collections programmatically:
# Get your Postman API key from: https://web.postman.co/settings/me/api-keys
# List all collections
curl -s -X GET "https://api.getpostman.com/collections" \
-H "X-Api-Key: YOUR_POSTMAN_API_KEY" | jq '.collections[] | {name, uid}'
# Export a specific collection by UID
curl -s -X GET "https://api.getpostman.com/collections/YOUR_COLLECTION_UID" \
-H "X-Api-Key: YOUR_POSTMAN_API_KEY" \
-o my-collection.json
# Python script to export all collections
import requests
import json
import os
API_KEY = "YOUR_POSTMAN_API_KEY"
HEADERS = {"X-Api-Key": API_KEY}
BASE_URL = "https://api.getpostman.com"
# Get all collections
response = requests.get(f"{BASE_URL}/collections", headers=HEADERS)
collections = response.json()["collections"]
# Export each collection
os.makedirs("postman_backup", exist_ok=True)
for col in collections:
uid = col["uid"]
name = col["name"].replace(" ", "_").replace("/", "_")
detail = requests.get(f"{BASE_URL}/collections/{uid}", headers=HEADERS)
with open(f"postman_backup/{name}.json", "w") as f:
json.dump(detail.json(), f, indent=2)
print(f"Exported: {name}")
Method 3: Export via Postman CLI (Newman)
Newman is Postman's command-line tool. While it is primarily for running collections, you can combine it with the API for export workflows:
# Install Newman
npm install -g newman
# Export and run a collection in one step
curl -s "https://api.getpostman.com/collections/YOUR_COLLECTION_UID" \
-H "X-Api-Key: YOUR_POSTMAN_API_KEY" \
-o collection.json
# Run the exported collection
newman run collection.json --environment env.json
Method 4: Share via Public Link
For quick sharing without file exports:
- Click the three dots next to your collection
- Select Share
- Choose Get public link
- Copy the link and share it
Anyone with the link can view and import the collection.
Importing Collections
Method 1: Import JSON File
The most common import method:
- Open Postman
- Click Import in the top-left corner (or press Ctrl/Cmd + O)
- Choose one of:
- Drag and drop your
.jsonfile - Upload files -- browse to select the file
- Paste raw text -- paste the JSON content directly
- Drag and drop your
- Postman shows a preview of what will be imported
- Click Import to confirm
Method 2: Import from URL
Import a collection directly from a URL:
- Click Import in Postman
- Select the Link tab
- Paste the URL to a collection JSON file (e.g., from GitHub, a Gist, or a public Postman link)
- Click Continue and then Import
# Example URLs that work:
https://raw.githubusercontent.com/user/repo/main/collection.json
https://api.getpostman.com/collections/UID?apikey=KEY
https://www.getpostman.com/collections/SHARE_ID
Method 3: Import from cURL
You can import individual requests from cURL commands:
- Click Import
- Select Raw text
- Paste your cURL command:
curl -X POST "https://api.example.com/users" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token123" \
-d '{"name": "John", "email": "john@example.com"}'
- Postman converts it to a request automatically
Method 4: Import from OpenAPI/Swagger
Import an entire API from its OpenAPI specification:
- Click Import
- Upload your
openapi.yamlorswagger.jsonfile - Postman generates a complete collection with all endpoints
# Or import from URL
# Paste this URL in the Import > Link tab:
https://petstore.swagger.io/v2/swagger.json
Postman supports:
- OpenAPI 3.0 and 3.1 (YAML and JSON)
- Swagger 2.0
- GraphQL schemas
- RAML
- WSDL
Method 5: Import via Postman API
# Import a collection via the API
curl -X POST "https://api.getpostman.com/collections" \
-H "X-Api-Key: YOUR_POSTMAN_API_KEY" \
-H "Content-Type: application/json" \
-d @my-collection.json
# Python: Import a collection
import requests
import json
API_KEY = "YOUR_POSTMAN_API_KEY"
with open("my-collection.json") as f:
collection_data = json.load(f)
response = requests.post(
"https://api.getpostman.com/collections",
headers={
"X-Api-Key": API_KEY,
"Content-Type": "application/json"
},
json=collection_data
)
print(response.json())
Exporting and Importing Environments
Collections often depend on environment variables. Export those too.
Export Environment
- Click Environments in the left sidebar
- Click the three dots next to the environment
- Select Export
- Save the
.jsonfile
Import Environment
- Click Import
- Upload the environment JSON file
- Postman adds it to your Environments
Environment File Format
{
"name": "Production",
"values": [
{
"key": "base_url",
"value": "https://api.example.com",
"type": "default",
"enabled": true
},
{
"key": "api_key",
"value": "sk-your-key-here",
"type": "secret",
"enabled": true
}
]
}
Warning: Exported environments include secret values in plaintext. Remove sensitive values before sharing.
Supported Import/Export Formats
| Format | Import | Export | Notes |
|---|---|---|---|
| Postman Collection v2.1 | Yes | Yes | Recommended format |
| Postman Collection v2.0 | Yes | Yes | Older format |
| OpenAPI 3.0/3.1 | Yes | Yes | Industry standard |
| Swagger 2.0 | Yes | No | Legacy format |
| cURL | Yes | Yes (per request) | Single requests only |
| HAR | Yes | No | HTTP Archive format |
| GraphQL | Yes | No | Schema import |
| RAML | Yes | No | RESTful API Modeling |
| WSDL | Yes | No | SOAP APIs |
Best Practices
Version Control Your Collections
Store collections in Git alongside your code:
# Project structure
my-api/
├── src/
├── tests/
├── postman/
│ ├── collection.json
│ ├── environment.dev.json
│ ├── environment.staging.json
│ └── environment.prod.json
├── package.json
└── README.md
Automate Collection Backup
#!/bin/bash
# backup-postman.sh - Run weekly via cron
API_KEY="YOUR_POSTMAN_API_KEY"
BACKUP_DIR="./postman-backups/$(date +%Y-%m-%d)"
mkdir -p "$BACKUP_DIR"
# Get all collection UIDs
COLLECTIONS=$(curl -s "https://api.getpostman.com/collections" \
-H "X-Api-Key: $API_KEY" | jq -r '.collections[] | .uid')
for UID in $COLLECTIONS; do
NAME=$(curl -s "https://api.getpostman.com/collections/$UID" \
-H "X-Api-Key: $API_KEY" | jq -r '.collection.info.name' | tr ' /' '__')
curl -s "https://api.getpostman.com/collections/$UID" \
-H "X-Api-Key: $API_KEY" \
-o "$BACKUP_DIR/${NAME}.json"
echo "Backed up: $NAME"
done
Remove Secrets Before Sharing
# strip-secrets.py - Remove sensitive values before sharing
import json
import sys
with open(sys.argv[1]) as f:
env = json.load(f)
for val in env.get("values", []):
if val.get("type") == "secret":
val["value"] = "REPLACE_ME"
with open(sys.argv[1].replace(".json", "-clean.json"), "w") as f:
json.dump(env, f, indent=2)
Troubleshooting
| Issue | Solution |
|---|---|
| Import fails with "invalid format" | Check the JSON is valid; use a JSON validator |
Variables show as {{undefined}} |
Import the environment file alongside the collection |
| Collection v2.0 vs v2.1 mismatch | Re-export using v2.1 format |
| Large collection import is slow | Split into smaller collections by feature |
| Shared link expired | Generate a new public link from the collection |
| Scripts not running after import | Check that script dependencies are documented |
Frequently Asked Questions
Can I import Postman collections into other tools? Yes. Tools like Insomnia, Thunder Client (VS Code), and Bruno support Postman collection format. OpenAPI export works with virtually any API tool.
Is there a size limit for collection export? Postman does not enforce a strict size limit, but very large collections (100MB+) may be slow to import. Consider splitting them.
Can I merge two collections? There is no built-in merge feature. Export both as JSON, combine them manually or with a script, and re-import.
Do exported collections include test results? No. Exports include test scripts but not historical test results. Use Newman for CI/CD test runs.
Wrapping Up
Exporting and importing Postman collections is straightforward once you know the available methods. For team workflows, use the Postman API for automation. For version control, export as JSON and commit to Git. For cross-tool compatibility, use OpenAPI format.
If you are testing AI-powered APIs for image generation, video creation, or avatar synthesis, try Hypereal AI free -- 35 credits, no credit card required. The API comes with a Postman-ready collection for easy testing.
Related Articles
Start Building Today
Get 35 free credits on signup. No credit card required. Generate your first image in under 5 minutes.
