Postman API
  1. Import
Postman API
  • API
    • Get all APIs
      GET
    • Create API
      POST
    • Delete an API
      DELETE
    • Single API
      GET
    • Update an API
      PUT
    • Get All API Versions
      GET
    • Create API Version
      POST
    • Delete an API Version
      DELETE
    • Get an API Version
      GET
    • Update an API Version
      PUT
    • Get contract test relations
      GET
    • Get documentation relations
      GET
    • Get environment relations
      GET
    • Get integration test relations
      GET
    • Get monitor relations
      GET
    • Get linked relations
      GET
    • Create relations
      POST
    • Create Schema
      POST
    • Get Schema
      GET
    • Update Schema
      PUT
    • Create collection from schema
      POST
    • Get test suite relations
      GET
    • Sync relations with schema
      PUT
  • Collections
    • All Collections
      GET
    • Create Collection
      POST
    • Create a Fork
      POST
    • Merge a Fork
      POST
    • Delete Collection
      DELETE
    • Single Collection
      GET
    • Update Collection
      PUT
  • Environments
    • All Environments
    • Create Environment
    • Delete Environment
    • Single Environment
    • Update Environment
  • Import
    • Import exported data
      POST
    • Import external API specification
      POST
  • User
    • API Key Owner
  • Mocks
    • All Mocks
    • Create Mock
    • Delete Mock
    • Single Mock
    • Update Mock
    • Publish Mock
    • Unpublish Mock
  • Monitors
    • All Monitors
    • Create Monitor
    • Delete Monitor
    • Single Monitor
    • Update Monitor
    • Run a Monitor
  • Webhooks
    • Create Webhook
  • Workspaces
    • All workspaces
    • Create Workspace
    • Delete Workspace
    • Single workspace
    • Update Workspace
  1. Import

Import external API specification

POST
/import/openapi
Import
This endpoint allows you to import external API specifications into Postman.
Currently, this endpoint only supports the OpenAPI specification, for which the importType will be openapi.
On a successful import, the response will be an array with each element contaning id, name and uid of entities created.
Supported types:
string
json
file
The input parameter should be defined based on the type.
To import a file, request body must be form-data with type param set to file.
Note: Refer to examples for different scenarios.
Requires API Key as X-Api-Key request header.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.getpostman.com/import/openapi' \
--header 'Content-Type: application/json' \
--data-raw '{
    "input": {
        "info": {
            "license": {
                "name": "MIT"
            },
            "title": "Swagger Petstore",
            "version": "1.0.0"
        },
        "openapi": "3.0.0",
        "paths": {
            "/pets": {
                "get": {
                    "operationId": "listPets",
                    "parameters": [
                        {
                            "description": "limit",
                            "in": "query",
                            "name": "limit",
                            "required": false,
                            "schema": {
                                "format": "int32",
                                "type": "integer"
                            }
                        }
                    ],
                    "responses": {
                        "default": {
                            "content": {
                                "application/json": {
                                    "schema": {
                                        "properties": {
                                            "code": {
                                                "format": "int32",
                                                "type": "integer"
                                            },
                                            "message": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "code",
                                            "message"
                                        ]
                                    }
                                }
                            },
                            "description": "unexpected error"
                        }
                    },
                    "summary": "List all pets"
                }
            }
        },
        "servers": [
            {
                "url": "http://petstore.swagger.io/v1"
            }
        ]
    },
    "type": "json"
}'
Response Response Example
200 - Success: Import to a specific workspace with workspace ID passed as a query parameter
{
  "collections": [
    {
      "id": "b31be584-1b1e-4444-b581-761edf88fe77",
      "name": "Swagger Petstore",
      "uid": "2282-b31be584-1b1e-4444-b581-761edf88fe77"
    }
  ]
}

Request

Body Params application/json
input
object 
optional
info
object 
optional
openapi
string 
optional
Example:
3.0.0
paths
object 
optional
servers
array [object {1}] 
optional
type
string 
optional
Example:
json
Examples

Responses

🟢200Success: Import to a specific workspace with workspace ID passed as a query parameter
application/json
Body
collections
array [object {3}] 
optional
id
string 
optional
Example:
b31be584-1b1e-4444-b581-761edf88fe77
name
string 
optional
Example:
Swagger Petstore
uid
string 
optional
Example:
2282-b31be584-1b1e-4444-b581-761edf88fe77
🟠400Error: Param Missing
Previous
Import exported data
Next
API Key Owner
Built with