Postman can export and import collections, environments, globals and header presets as files and links. This topic covers:
Postman can export and import the following formats as a file or generated URL. When you export a collection from the Postman app, the exported file is a JSON file. The file contains all data (and metadata) that is required by Postman to recreate the collection when imported back into Postman, or that is utilized by Newman to run the collection from the command line interface (CLI).
Postman can export collections in two formats - v1 and v2. Both Collection v1 and v2 download as JSON files; v2 is more versatile and the most-used choice. Learn more about the v1 and v2 formats.
Environments can be exported from the MANAGE ENVIRONMENTS modal, and imported here as well.
From the Data tab of the SETTINGS modal, Postman allows you to export all collections, environments, globals and header presets into one JSON file. Postman does not export your history. You can import this data back into Postman.
Postman data can be imported from the Data tab of the SETTINGS modal, or using the Import button in the header toolbar. Import a collection, environment, data dump, curl command, or a RAML / WADL / Swagger (v1/v2) / Runscope file using the IMPORT modal.
Most valid cURL (HTTP-only) commands can be imported into Postman. Postman’s importer supports the following cURL options:
Option | Description |
-A, –user-agent |
An optional user-agent string |
-d, –data |
Sends the specified data to the server with type application/x-www-form-urlencoded |
–data-ascii |
Sends the specified data to the server with type application/x-www-form-urlencoded |
–data-urlencode |
Sends the specified data to the server with type application/x-www-form-urlencoded |
–data-binary |
Data sent as-is |
-F, –form <name=content> | A single form-data field (can be used multiple times) |
-G, –get | Forces the request to be sent as GET, with the –data parameters appended to the query string |
-H, –header |
Add a header (can be used multiple times) |
-X, –request |
Specify a custom request method to be used |
–url |
An alternate way to specify the URL |
A few commands which can be imported include:
cURL | Effect |
curl http://postman-echo.com/get | Creates a GET request in Postman with the URL prefilled |
curl –request POST –url http://postman-echo.com/post –form color=red –form color=green | Creates a POST request with a multivalue form data row |
curl -X PUT –data-binary hello http://postman-echo.com/put | Creates a POST request with raw data |
curl -X PUT –data-ascii ‘a=b&c=d’ http://postman-echo.com/put -H ‘AccessToken:1234’ | Creates a PUT request with urlencoded form data, and a custom header |
You’re done! Postman will detect all the RAML definitions and convert them internally to Postman and then show you an import success message.
Download an example RAML file: github-api-v3.raml
Note: Postman supports RAML 1.0.
A Swagger API definition usually lives as a single file, so we only support imports of single swagger files. If you have a lot of unrelated Swagger files in a folder, you can import those through the folder importer.
Clone the repository containing the Swagger definition to your local machine. If you have it saved locally as file already, that’s fine of course.
Click on the Import button, and choose the Import File tab. If you have a lot of unrelated Swagger files in a folder, you can import those through the folder importer.
You’re done! Postman will detect all the Swagger definitions and convert them internally to Postman and then show you an import success message.
Postman lets you import WADL specs too. While all aspects are not supported yet, you can expect the various parameters that Postman uses (collections, folder, requests, headers, request payloads) to be correctly generated. We’re currently working on extending this feature.
<application xmlns="http://wadl.dev.java.net/2009/02">
<resources base="http://example.com/api">
<resource path="books">
<method name="GET"/>
<resource path="{bookId}">
<param required="true" style="template" name="bookId"/>
<method name="GET"/>
<method name="DELETE"/>
<resource path="reviews">
<method name="GET">
<request>
<param name="page" required="false" default="1" style="query"/>
<param name="size" required="false" default="20" style="query"/>
</request>
</method>
</resource>
</resource>
</resource>
<resource path="readers">
<method name="GET"/>
</resource>
</resources>
</application>
To validate if a JSON file is in the correct collections format, you can use our schema files for collections.