Importing from Postman

Bring your Postman collections and environments over and keep working with them as plain files. The import wizard shows what converts before writing anything, never overwrites a file and leaves a report of what needs a look.

Exporting from Postman

  • A collection: in Postman, open the collection's menu, choose Export and pick Collection v2.1. You get a *.postman_collection.json file.
  • An environment: open the environment's menu and choose Export. You get a *.postman_environment.json file. Globals export the same way.
  • Everything: Postman's data export gives a .zip with your collections and environments.

Importing

Postman goes through the same three step wizard as OpenAPI. Open it from the sidebar's Import menu, Postman (collection or environment)…, from Import from Postman… in the welcome tab, or from the command palette. Dropping a file anywhere on the window opens it too, on the Options step. It works with or without a workspace open.

Step 1: Source

The format is detected from the content, whatever chip is selected: info.schema names a collection and _postman_variable_scope an environment or the globals.

  • File: one or more files, picked or dropped, or a .zip data export.
  • Paste text: one export pasted as JSON.
  • Folder: every Postman export in a folder and its subfolders.

The list shows what was found, with a checkbox for each file. Environments are imported with the collection; uncheck the ones you do not want. An environment or the globals can be imported on their own, with no collection.

Step 2: Options

The Destination block works as for OpenAPI. Then the name of the collection, the environments, and what to convert:

OptionDefaultWhat it does
Folders to subfoldersOnKeeps the names and the order. Off, every request goes at the top of the collection.
Collection variables to every environmentOnPostino activates one environment at a time, so collection variables and globals are copied into each one. A value of the environment wins.
Secrets to .local.envOnVariables of type secret go to .local.env, out of the versioned file. Off, they are left out.
AuthorizationOnConverts the auth of each request. Off, requests have none.
Convert pm.* scriptsOnConverts scripts. Off, they are copied as comments.
Descriptions and saved examplesOffWrites them in the Docs tab of each request.

Step 3: Preview

The tree of requests, with a checkbox on each, its path and what to know about it. Three counts sum up the selection: complete, with warnings and unsupported. Nothing has been written yet. The last button writes everything at once; if that fails, what the import created is removed.

The report

When some request needs a look, the last screen says how many and View report opens .postino/import-report.md, in the workspace: each request with what to review, and the warnings of the import. The next import replaces it. A workspace created by Postino keeps it out of Git.

Updating an imported collection

Postman exports carry an id, info._postman_id. A new export of a collection already imported into the destination is recognized by it, wherever the file is: the Preview step offers Update existing or Import as new collection. Use the wizard as usual, or the command palette's Update collection from Postman…. The list is the one of an OpenAPI update: added, changed with what changed, and removed, with a checkbox for each. Changed requests keep their scripts, tests and the values you edited. Environments are left as they are. A small .openapi.toml in the collection folder remembers the import. Pasted text works too, since the id comes in the export. Several collections imported together have no single id and are not updated this way.

Collections

The collection becomes a new folder at the root of the workspace, named after it. If a folder with that name exists, the new one gets a (2), (3) suffix, so nothing is ever overwritten. Postman folders become subfolders, and each request becomes a .postino file.

PostmanPostino
FolderFolder
RequestA .postino file
MethodThe method of the request line
URL, without its query stringThe URL of the request line
Query parametersThe ::: query section
Headers, including disabled onesHeaders; disabled ones as # lines
Raw body (JSON, XML or text)::: body json, xml or text; text when no language is set
URL-encoded body::: body form
Form-data body::: body multipart; a file field becomes @path, with a warning, since that path rarely exists on another machine
File and GraphQL bodiesAn empty body, with a warning
Bearer, Basic and API key auth (header or query)The ::: auth section, shown in the Auth tab
OAuth 2.0 authAn OAuth 2.0 profile of the workspace, named after the token name or the collection, and the requests use it. Requests with the same settings share one profile. A client secret or password written in clear goes to a variable of .local.env (with the Secrets option). The stored access token is not imported: Postino gets its own on Send. The implicit grant becomes authorization code with PKCE, and Postman's own callback the loopback redirect, with a warning
OAuth 1.0, Digest, AWS, Hawk and other authNo auth, with a warning
Auth set on the collection or a folderCopied to every request below that inherits it
Description and saved examplesThe ::: docs section, when the option is on
{{variable}}Kept as is: the syntax is the same
Collection variables and globalsCopied into every imported environment; without any, environments/<collection name>.env. Type secret goes to .local.env
Request pre-request and test scripts::: pre and ::: post, converted
Collection and folder scriptsNot imported, with a warning for each

Postman Collection format v2.1 is supported. Files in format v2.0 are accepted when they parse the same way. Fields with no equivalent in Postino are ignored.

Names are made safe for every operating system: characters Windows does not allow become _, leading dots and trailing dots and spaces are removed and names are cut to 120 characters. Two requests with the same name in one folder get a (2) suffix.

Scripts

A request's scripts are converted to Postino's script API with the translation table. A statement that uses something Postino does not have, such as pm.sendRequest or CryptoJS, stays as a comment, so the script still runs:

GET {{baseUrl}}/users

::: post
// Imported from Postman. What could not be converted is commented out below.
test("Status code is 200", function () {
    expect(res.status).toBe(200);
});
// pm.sendRequest("https://example.com", (err, res) => {
//     console.log(res);
// });

Scripts set on the collection or a folder are not imported, since Postino scripts belong to one request; each one is reported:

folder "Users": a test script is not imported at the folder level, only per request

Environments

A Postman environment export becomes environments/<name>.env. Variables of type secret go to environments/<name>.local.env instead, so they stay out of git: a workspace created for the import already ignores them, and in an existing folder you add *.local.env to your .gitignore.

From the command line

postino import postman <source> runs this import with the wizard's default choices, from files, a folder or a .zip. See the command line reference.

After importing

  • Look at the warnings: they list every body, auth and script that needs your attention.
  • Activate the environment, send a few requests and compare with Postman.
  • Adapt the statements left as comments in the scripts.
  • Commit the result. From now on, a change to a request is a one line diff.

Found a mistake? Edit this page on GitHub or open an issue.

↑↓to move ↵to open /or Ctrl Kto search from any page