Import API collections from the command line
The app's import dialog is the easy way to bring one collection in. The CLI is the repeatable way: the same command for twenty files, in a script, in CI, or on a server with no desktop.
The basics
requestarium import orders.postman_collection.json
requestarium import openapi.yaml --name "Billing API" --environments
requestarium import https://api.example.com/openapi.yaml
cat export.json | requestarium import -The format is detected from the content: Postman v2.0/v2.1, OpenAPI 3 and Swagger 2 (JSON or YAML), Requestarium JSON, Insomnia v4 and v5, Thunder Client, Bruno (a folder, its zip, or one .bru file), Hoppscotch, HAR, .http files, and curl commands. A URL is downloaded by the CLI, up to 20 MB.
Look before you import
requestarium import big-export.json --preview--preview lists the folders and requests as paths, with notes about anything that can't come over, and creates nothing. --dry-run goes one step further and shows exactly what would be created where.
Only part of a file
A Postman export with 300 requests, of which you need the Orders folder and one health check:
requestarium import big-export.json --select "Orders" --select "Health/Ping"
requestarium import big-export.json --select "**/Login"* matches within one name, ** across folders. A path that matches nothing stops the import, so a typo doesn't quietly import nothing.
Merge into a collection you already have
requestarium import orders-v2.postman_collection.json --into "Shop API" --folder "Orders" --on-conflict skip --dry-runFolders are matched by path and requests by folder path and name:
--on-conflict | When a request already exists |
|---|---|
skip | keep yours |
overwrite | replace it with the file's version (it keeps its history) |
keep-both | add the file's as "Name (2)" |
Requests that are already identical are skipped either way, so running the same merge twice changes nothing. Check with --dry-run, then run it without.
Secrets
Exports are full of pasted tokens. Decide what happens to them:
requestarium import export.json --secrets storestoremoves each secret into a secret environment variable and replaces it in the requests with a{{variable}}.emptydoes the same, without the values.keepimports them as they are.
For full control over which environment each variable goes to, see import without leaking secrets.
Scripts
Postman, Insomnia, Bruno, Hoppscotch and Thunder Client scripts are converted to the pm API by default. For a full list of what was converted and what wasn't:
requestarium import export.json --preview --script-report scripts.mdMore in Postman scripts compatibility.
Many files at once
for f in exports/*.postman_collection.json; do
requestarium import "$f" --secrets store || echo "✗ $f"
doneEach import is recorded in the import history, so you can undo one without touching the others: requestarium import history, then requestarium import undo ID. See undo an import.