Import a Postman or Insomnia collection without bringing its secrets along as plain text

Open any Postman export from a team that's used it for a few years and search for Bearer. You'll find tokens in environment files, in collection variables, and pasted straight into a request's Authorization header by someone in a hurry. Importing that file as it is copies every one of them into the new tool as plain text.

Requestarium's import preview has a Variables and secrets step that deals with them before anything is created.

What it finds

A value counts as a secret when:

  1. the source format flags it (Postman type: secret, the secret flags of Insomnia, Thunder Client, Hoppscotch and Bruno, OpenAPI security credentials);
  2. it looks like one: a JWT, an AWS access key, GitHub, GitLab, Slack, Stripe or Google keys, sk-… keys, Postman API keys, private keys, Bearer … values;
  3. its name looks like one: password, secret, token, apiKey, clientSecret, cookie… unless it ends in something that isn't, like Url, Id or Name.

It also finds credentials typed directly into auth settings (bearer tokens, API keys, passwords, OAuth client secrets, AWS keys) and into secret headers such as Authorization, Cookie and X-Api-Key. Empty values and values that are only a {{reference}} are never flagged.

What you choose

ChoiceWhat happens
Store as secret (default)the value goes into a secret environment variable: encrypted at rest, masked in every app
Keep as plain valueimported exactly as in the file
Leave emptya secret variable is created without a value, for each person to fill in

A credential found in a request is replaced by a variable named after the field, and the header keeps its scheme: Authorization: Bearer {{authorization}}. The same value gets the same name everywhere, so ten requests with the same pasted token end up pointing at one variable.

Collection variables aren't encrypted in Requestarium, so secret ones move into the imported environments. When the file has no environments, they go into a new Secrets environment.

Leave empty is the safest choice when the export came from someone else's machine: nobody inherits a token they shouldn't have, and the missing-variable check tells people what to fill in before they send.

Rename and merge while you're there

  • Rename a variable, and every environment, the collection, and every {{reference}} in URLs, bodies, auth, headers and scripts are updated. Good for turning url into baseUrl to match the rest of your workspace.
  • Merge into an existing environment instead of creating "Production (2)". Variables it already has keep their values unless you tick Replace values the existing environment already has.
  • Leave out variables and environments you don't want.

From the command line

The CLI changes nothing unless you ask, so existing scripts keep working. To use the same rules:

Terminal
# One choice for every secret
requestarium import ./shop.postman.json --secrets store

# Write a mapping file with every variable, edit it, then import with it
requestarium import ./shop.postman.json --preview --env-map-template > map.json
requestarium import ./shop.postman.json --env-map map.json

The mapping file takes the same choices as the preview: which environment each imported one goes to, renames, variables to skip, and a choice per secret. That's handy when you're moving a whole team off Postman and want every collection imported the same way.

What the report says

The import report and the import history say how many secrets were found, stored, kept or left empty, and which credentials became variables. Values are never part of the report. A re-run of the import from history opens the preview with the same choices.