Import data from a Git repository

If you have API definitions, collections, or environments in a Git repository, you can import the data so you can work with it in Postman.

Postman supports importing from GitHub, Bitbucket, GitLab, and Azure DevOps repositories. You can import data from a local repository on your computer or from a remote repository hosted in the cloud.

You can also connect your API to a remote GitHub, Bitbucket, GitLab, or Azure DevOps repository. Once connected, you can sync your API definition and associated collections in Postman with the remote repository. Learn more about connecting your API to a Git repository.

Import from a local Git repository

You can import data from a local GitHub, Bitbucket, GitLab, or Azure DevOps repository on your computer.

  1. In Postman, select Import in the sidebar.

  2. On your computer, open your local repository and locate the files or folders you want to import. Drag and drop the files or folders into Postman.

  3. Select options based on what you're importing:

    • If you're importing an API definition, you can choose to import the definition as a collection or as an API along with a collection.

      API definition import options
    • If you're importing an API definition along with other files such as collections or environments, select the files you want to import into Postman. By default, API definitions are imported as collections. Select the Import (API specification) files checkbox to import the definition as an API along with a collection.

      File import options

    Select View Import Settings for more configuration options. These options will vary depending on your API specification.

  4. Select Import.

  5. An Import Complete message displays in the footer. In the message, select the link icon External link icon next to a collection, environment, or API to open the imported element.

    Import complete message

Import from a remote Git repository

You can import data from a remote GitHub, Bitbucket, GitLab, or Azure DevOps repository hosted in the cloud.

  1. In Postman, select Import in the sidebar.

  2. Select the type of repository you want to import from. Select Other Sources and then select GitHub, Bitbucket, GitLab, or Azure.

  3. A browser tab opens asking you to sign in to your repository. Follow the onscreen instructions. When you're finished, close the browser tab and return to Postman.

    Postman stores your authorized accounts so you can use them to connect to other repositories and services. Learn more about managing connected accounts for remote repositories.

  4. In Postman, select the Organization or Workspace and the Repository you want to import from. (For GitLab, select the Group and Project.) Then select the Branch with the data you want to import.

  5. Select Continue, then select options based on what you're importing:

    • If you're importing an API definition, you can choose to import the definition as a collection or as an API along with a collection.

      API definition import options
    • If you're importing an API definition along with other files such as collections or environments, select the files you want to import into Postman. By default, API definitions are imported as collections. Select the Import (API specification) files checkbox to import the definition as an API along with a collection.

      File import options

    Select View Import Settings for more configuration options. These options will vary depending on your API specification.

  6. Select Import.

  7. An Import Complete message displays in the footer. In the message, select the link icon External link icon next to a collection, environment, or API to open the imported element.

    Import complete message

Last modified: 2023/10/18