Import an API into Postman

You can import an existing API definition into Postman. API definitions can be imported from a local file or directory, a URL, raw text, or an API gateway.

You can also import an API definition from a code repository. Learn more about importing data from a Git repository.

Import an API definition

  1. In Postman, select Import in the sidebar.

  2. Select an API definition file, enter a link to the API, or paste your raw text.

  3. You can choose to import the definition as a collection or as an API along with a collection.

    API definition 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 or API to open the imported element.

    Import complete message

Import a multi-file API definition

  1. In Postman, select Import in the sidebar.

  2. Select folders, then select a local folder with your API files.

  3. 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 or API to open the imported element.

    Import complete message

To learn more about working with multi-file API definitions, see Work with multi-file API definitions.

Import API definitions from Amazon API Gateway

Amazon API Gateway enables developers to publish and manage APIs that access AWS and other web services and data sources. You can import APIs directly from AWS Gateway to Postman. This creates an integration with API Gateway. Once connected, you can view your API deployment status and history from within Postman. You can also view Amazon CloudWatch metrics for each stage to get operational insight into your API.

This integration supports importing OpenAPI 3.0 definitions for both HTTP and REST APIs. Importing a definition will create a new API in Postman and will also configure an integration with AWS API Gateway.

To import an API from AWS API Gateway, do the following:

  1. Select Import in the sidebar, then select Other Sources > AWS API Gateway.
  2. Connect to the AWS API Gateway as follows.

When importing an API from AWS API Gateway, you can choose to authenticate by creating an AWS IAM role or by using an AWS access key. Follow the steps for your chosen method:

Authenticate with an AWS IAM role

To set up a connection to Amazon API Gateway using an AWS IAM role, do the following:

  1. Select IAM under AWS Authentication Mechanism.

    Connecting with AWS IAM role
  2. Select the AWS API Type (HTTP or REST).

To create an IAM role for Postman in AWS, do the following:

  1. Sign in to the AWS IAM console and select Create role.

  2. Under Select type of trusted entity, select AWS account.

  3. Under An AWS account, select Another AWS account and enter Postman's AWS Account ID: 258201882842

  4. Under Options, select the Require external ID checkbox and enter the External ID from Postman. You can find the external ID in Postman's Connect to AWS API Gateway procedure under Step 1: Create an IAM role, as shown in Authenticating with an AWS IAM role.

    For more information, refer to the AWS IAM guide on using external IDs.

  5. Select Next: Permissions.

  6. Select an existing IAM policy or select Create policy. If you are creating a policy, use the following JSON code:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "Stmt909923626743",
                "Effect": "Allow",
                "Action": [
                    "apigateway:GET",
                    "apigateway:PUT",
                    "apigateway:POST",
                    "cloudwatch:GetMetricData"
                ],
                "Resource": [
                    "*"
                ]
            }
        ]
    }
    

    This policy will enable exporting and deploying for HTTP API definitions. (Exporting and deploying aren't supported for REST API definitions.) You can customize the Action section in the IAM policy based on your needs:

    • "apigateway:GET" - (Required) Enables viewing API Gateway deployments for HTTP and REST APIs in Postman.
    • "apigateway:PUT" - Enables exporting HTTP API definitions to the API Gateway.
    • "apigateway:POST" - Enables deploying HTTP API definitions to a stage on the API Gateway.
    • "apigateway:*" - Assigns all GET, PUT, POST, PATCH, DELETE permissions to the IAM role.
    • "cloudwatch:GetMetricData" - Enables viewing CloudWatch metrics in Postman.
  7. Select Next: Tags.

  8. Select Next: Review.

  9. Add a Role name and Role description, then select Create role.

Copy the Role ARN from AWS and paste it in Postman under Step 2: Enter role ARN and region. Next, enter the AWS Region where the API Gateway is located and select the API Gateway. Then, enter an API Name for the imported API. When you're ready, select Connect.

Authenticate with an AWS access key

To set up a connection to Amazon API Gateway using an AWS access key, select Access Key under AWS Authentication Mechanism.

Connecting with AWS access key

Next, enter information about the connection:

  • Select the AWS API Type (HTTP or REST).
  • Enter the Access Key ID and Secret Access Key for your AWS account. (Learn how to find your credentials in AWS.)
  • Enter the AWS Region where the API Gateway is located and select the API Gateway.
  • Enter an API Name for the imported API.

When you're ready, select Import. After importing your API definition, you can view API deployments in Postman.

Import API definitions from Azure API Management

You can import a definition from a connected Azure API Management service to an API in Postman. Importing a definition will create a new API in Postman and will also configure an integration with Azure API Management. Learn more about integrating with Azure API Management.

To import an API definition from Azure API Management, do the following:

  1. Select Import in the sidebar, then select Other Sources > Azure API Management.

  2. You'll be prompted to authorize Postman to access your Microsoft Azure account. After you grant access, you can close the browser tab and return to Postman.

  3. Enter information about the Azure API Management service you want to import a definition from:

    • Subscription - The subscription where the service was created.
    • Resource Group - The resource group that has the service.
    • Service - The Azure API Management service instance used for deploying your API.
    • Azure API Version - The Azure API version you want to import.
    • Definition type - Select the specification for the definition you want to import (OpenAPI 2.0 or OpenAPI 3.0).
    • API name - The name to use for the new API that will be created in Postman using the imported definition.
  4. Select Import.

    Importing an API definition from Azure API Management

Supported API definitions formats

Postman directly supports importing the following formats:

There are also tools on GitHub to convert different API specifications into a Postman Collection that can be imported:

Last modified: 2024/05/24