Logo
30 days of Postman - for developers API Documentation

Import external API specification

POST https://api.getpostman.com/import/openapi

This endpoint allows you to import external API specifications into Qodex.

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.

 

Body PARAM

Key Datatype Required Description 



HEADERS

Key Datatype Required Description 
Content-Type
string




RESPONSES

status OK

{ "collections": [ { "id": "b31be584-1b1e-4444-b581-761edf88fe77", "name": "Swagger Petstore", "uid": "2282-b31be584-1b1e-4444-b581-761edf88fe77" } ] }



Curl
curl -X POST 'https://api.getpostman.com/import/openapi' -H 'Content-Type: application/json' -d '{"type":"json","input":{"openapi":"3.0.0","info":{"version":"1.0.0","title":"Swagger Petstore","license":{"name":"MIT"}},"servers":[{"url":"http://petstore.swagger.io/v1"}],"paths":{"/pets":{"get":{"summary":"List all pets","operationId":"listPets","parameters":[{"name":"limit","in":"query","description":"limit","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"default":{"description":"unexpected error","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}}}}}}}}}}'

ENDPOINTS