Import external API specification
POST
/import/openapi
Import
importType
will be openapi
.id
, name
and uid
of entities created.type
s:input
parameter should be defined based on the type
.To import a file, request body must be form-data with type
param set tofile
.
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
Responses
Modified at 2023-08-15 05:41:03