How to Export Your API Definition Files

Last updated: November 20, 2026

Before Astra can import your API endpoints, you need to export your API definition files from the tool where you keep them. This article shows how to export a Postman collection and environment, a Hoppscotch collection and environment, and an OpenAPI document. For a HAR file, read 📄 How to generate a HAR file.

If some application URLs are missing from your scan results, read Why certain URLs may not appear in the scan sitemap to understand the common causes and how to improve coverage.

Which files to export

Tool

Files to export

Upload them in

Postman

The collection, and the environment if the collection uses variables

API definitions (setup) or Definition Files (settings), on the Postman tab

Hoppscotch

The collection, and the environment if the collection uses variables

The same place, on the Hoppscotch tab

OpenAPI

The spec as a .json, .yaml or .yml file

The same place, under OpenAPI Document

Export your files

Follow the steps for your tool.

Postman collection

  1. Click the options menu next to your API collection in Postman.

  2. Choose Export, and then click Export in the dialog that opens.

  3. Choose where to save the file and click Save.

Postman environment variables

  1. Select the environment you want to share from the selector in the top right corner.

  2. Click the environment quick look button.

  3. Click Edit.

  4. Click the options menu and choose Export.

  5. Choose where to save the file and click Save.

Hoppscotch collection and environment

  1. In Hoppscotch, click the more icon next to the collection or the environment.

  2. Click Export.

  3. Choose where to save the file and click Save.

Astra accepts the exported Hoppscotch files directly, so you don't need to convert them.

image.png

OpenAPI document

  1. Sign in to your Swagger or OpenAPI platform.

  2. Scroll to the export section at the bottom of the page.

  3. Right-click json and choose Download Linked File.

Upload the files to Astra

  1. Open the Targets page. For a target that is still being set up, click Setup on its row. For an active target, click the settings icon on its row and open Definition Files.

  2. Open the tab for your tool and drop each file on the upload area, or click the area to browse.

Read more in 📄 How to import your API endpoints.

Best practices

  • Export the collection and its environment file together. A collection often can't run without the variables it uses.

  • Make sure the collection runs before you export it. In Postman, use Run Collection and confirm every request returns a valid response.

  • Give each file a name that includes the date or version, so you can tell which one you uploaded.

Troubleshooting

The environment file wasn't uploaded with the collection

What you see: The collection imported, but its requests fail.

What to do: Upload the environment file in the same tab as the collection.

You opened the menu of a single request

What you see: Export isn't in the Postman menu.

What to do: Use the options menu next to the collection itself.

Your browser handles the download link differently

What you see: The OpenAPI JSON file doesn't download.

What to do: Open the export section in another browser, or right-click the link and choose Save link as.