> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getpostchi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Postman & OpenApi 

> Import a Postman collection or open api spec into Postchi and convert your existing requests to postchi .chttp files. If you have an open api spec you can add it as a source so you can always stay in sync with it's changes.

Postchi can import collections exported from Postman. You can import a single collection as a `.json` file, or import an entire workspace as a `.zip` archive.

You can also import an open api spec either as .json or .yaml file.

Postchi converts each request into a `.chttp` file and recreates your folder structure.

<Tip>
  If you have an open api spec you can add it as a source so you can always stay in sync with it's changes.
</Tip>

## How to import

<Steps>
  <Step title="Open the Import menu in Postchi">
    From the file menu select **Import**
  </Step>

  <Step title="Choose import type">
    Select One time import
  </Step>

  <Step title="Choose your file">
    Drag your file in the drop zone or Select the  file you exported from Postman or an open api spec. Postchi detects the format automatically and imports everything immediately.
  </Step>

  <Step title="Review the imported collection">
    Postchi creates a folder in your `requests `directory named after the collection. Inside, each  request becomes a `.chttp` file, preserving the original folder structure.
  </Step>
</Steps>

## What gets imported

| Item                               | How it maps in Postchi                                                                              |
| ---------------------------------- | --------------------------------------------------------------------------------------------------- |
| Requests                           | Converted to `.chttp` files with method, URL, headers, and body                                     |
| Folder structure                   | Recreated as nested folders inside `requests/`                                                      |
| Request names                      | Used as the `.chttp` file name                                                                      |
| Basic and Bearer auth              | Converted to `basicAuth(<username>,<password>)` and `bearer(<token>)` in the `Authorization` header |
| Postman variables (`{{variable}}`) | Converted to Postchi variables (`<variable>`)                                                       |

## What doesn't get imported

Some Postman features don't have a direct equivalent in Postchi. You'll need to recreate these manually after import.

<Warning>
  **Pre-request and test scripts** are not imported. Postman scripts use the Postman sandbox API, which is not compatible with Postchi. Rewrite any logic you need as Postchi [before or after scripts](/scripts/overview).
</Warning>

* **Postman environments** — as of version 0.7.2 environments do not get imported, we will add this feature soon.

## After import

Once your collection is imported, review the generated `.chttp` files and:

<Tip>
  If your Postman collection used collection-level auth, configure it in Postchi using the [Folder Settings](/concepts/collections#authentication). Every request in the folder will then inherit the auth automatically.
</Tip>
