> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Import an OpenAPI definition

POST https://api.getpostman.com/import/openapi
Content-Type: application/json

Imports an OpenAPI definition into Postman as a new [Postman Collection](https://learning.postman.com/docs/getting-started/creating-the-first-collection/).

**Note:**

- The Postman web app does not support the `file` input method type.
- If you do not include the `workspace` query parameter, the system imports the definition into the oldest personal Internal workspace you own.
- For an example of importing a file, see the [Postman API collection](https://www.postman.com/postman/postman-public-workspace/example/12959542-08d74ce2-8150-4f72-99a7-11e60492eb47).


Reference: https://learning.postman.com/api-docs/api-reference/import/open-api-definition

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /import/openapi:
    post:
      operationId: openApiDefinition
      summary: Import an OpenAPI definition
      description: >
        Imports an OpenAPI definition into Postman as a new [Postman
        Collection](https://learning.postman.com/docs/getting-started/creating-the-first-collection/).


        **Note:**


        - The Postman web app does not support the `file` input method type.

        - If you do not include the `workspace` query parameter, the system
        imports the definition into the oldest personal Internal workspace you
        own.

        - For an example of importing a file, see the [Postman API
        collection](https://www.postman.com/postman/postman-public-workspace/example/12959542-08d74ce2-8150-4f72-99a7-11e60492eb47).
      tags:
        - import
      parameters:
        - name: workspace
          in: query
          description: The workspace's ID.
          required: true
          schema:
            $ref: '#/components/schemas/workspaceId'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/importOpenApiDefinition'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/import400Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ImportOpenApiDefinitionRequestUnauthorizedError
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ImportOpenApiDefinitionRequestInternalServerError
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Import_openApiDefinition_Request'
servers:
  - url: https://api.getpostman.com
    description: https://api.getpostman.com
  - url: https://api.eu.postman.com
    description: https://api.eu.postman.com
components:
  schemas:
    workspaceId:
      type: string
      title: workspaceId
    JsonSchemaType:
      type: string
      enum:
        - json
      description: The `json` type value.
      title: JsonSchemaType
    JsonSchemaInput:
      type: object
      properties: {}
      description: >-
        An object that contains a valid JSON OpenAPI definition. For more
        information, read the [OpenAPI
        documentation](https://swagger.io/docs/specification/basic-structure/).
      title: JsonSchemaInput
    GenerateCollectionOptionsRequestNameSource:
      type: string
      enum:
        - Fallback
        - URL
      default: Fallback
      description: >
        Determines how the generated collection's requests are named. If the
        `Fallback` value is passed, then the request is named after one of the
        following values in the schema:

        - `summary`

        - `operationId`

        - `description`

        - `url`
      title: GenerateCollectionOptionsRequestNameSource
    GenerateCollectionOptionsIndentCharacter:
      type: string
      enum:
        - Tab
        - Space
      default: Space
      description: The option for setting the indentation character type.
      title: GenerateCollectionOptionsIndentCharacter
    GenerateCollectionOptionsFolderStrategy:
      type: string
      enum:
        - Paths
        - Tags
      default: Paths
      description: >-
        Whether to create folders based on the specification's `paths` or `tags`
        properties.
      title: GenerateCollectionOptionsFolderStrategy
    generateCollectionOptions:
      type: object
      properties:
        requestNameSource:
          $ref: '#/components/schemas/GenerateCollectionOptionsRequestNameSource'
          default: Fallback
          description: >
            Determines how the generated collection's requests are named. If the
            `Fallback` value is passed, then the request is named after one of
            the following values in the schema:

            - `summary`

            - `operationId`

            - `description`

            - `url`
        indentCharacter:
          $ref: '#/components/schemas/GenerateCollectionOptionsIndentCharacter'
          default: Space
          description: The option for setting the indentation character type.
        parametersResolution:
          type: string
          default: Schema
          description: >-
            Generated collections use examples for parameter generation by
            default. Any existing collections generated using the schema
            parameter generation will continue to sync using their existing
            strategy.
        folderStrategy:
          $ref: '#/components/schemas/GenerateCollectionOptionsFolderStrategy'
          default: Paths
          description: >-
            Whether to create folders based on the specification's `paths` or
            `tags` properties.
        includeAuthInfoInExample:
          type: boolean
          default: true
          description: >-
            If true, include the authentication parameters in the example
            request.
        enableOptionalParameters:
          type: boolean
          default: true
          description: >-
            If true, enables optional parameters in the collection and its
            requests.
        keepImplicitHeaders:
          type: boolean
          default: false
          description: >-
            If true, keep the implicit headers from the OpenAPI specification,
            which are removed by default.
        includeDeprecated:
          type: boolean
          default: true
          description: >-
            If true, includes all deprecated operations, parameters, and
            properties in generated collection.
        alwaysInheritAuthentication:
          type: boolean
          default: false
          description: >-
            Whether authentication details should be included in all requests,
            or always inherited from the collection.
        nestedFolderHierarchy:
          type: boolean
          default: false
          description: >-
            If true, creates subfolders in the generated collection based on the
            order of the endpoints' tags.
      description: >-
        The advanced creation options and their values. For more details, see
        Postman's [OpenAPI to Postman Collection Converter OPTIONS
        documentation](https://github.com/postmanlabs/openapi-to-postman/blob/develop/OPTIONS.md).
        These properties are case-sensitive.
      title: generateCollectionOptions
    jsonSchema:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/JsonSchemaType'
          description: The `json` type value.
        input:
          $ref: '#/components/schemas/JsonSchemaInput'
          description: >-
            An object that contains a valid JSON OpenAPI definition. For more
            information, read the [OpenAPI
            documentation](https://swagger.io/docs/specification/basic-structure/).
        options:
          $ref: '#/components/schemas/generateCollectionOptions'
      required:
        - type
        - input
      title: jsonSchema
    JsonStringifiedType:
      type: string
      enum:
        - string
      description: The `string` type value.
      title: JsonStringifiedType
    jsonStringified:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/JsonStringifiedType'
          description: The `string` type value.
        input:
          type: string
          description: The stringified OpenAPI definition.
        options:
          $ref: '#/components/schemas/generateCollectionOptions'
      required:
        - type
        - input
      title: jsonStringified
    Import_openApiDefinition_Request:
      oneOf:
        - $ref: '#/components/schemas/jsonSchema'
        - $ref: '#/components/schemas/jsonStringified'
      title: Import_openApiDefinition_Request
    ImportOpenApiDefinitionCollectionsItems:
      type: object
      properties:
        id:
          type: string
          description: The collection's ID.
        name:
          type: string
          description: The collection's name.
        uid:
          type: string
          format: uid
          description: The collection's unique ID.
      title: ImportOpenApiDefinitionCollectionsItems
    importOpenApiDefinition:
      type: object
      properties:
        collections:
          type: array
          items:
            $ref: '#/components/schemas/ImportOpenApiDefinitionCollectionsItems'
      title: importOpenApiDefinition
    CommonErrorNameMessageError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
      description: Information about the error.
      title: CommonErrorNameMessageError
    commonErrorNameMessage:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorNameMessageError'
          description: Information about the error.
      title: commonErrorNameMessage
    CommonErrorNameMessageDetailsErrorDetails:
      oneOf:
        - type: object
          additionalProperties:
            description: Any type
        - type: array
          items:
            type: string
      description: Information about the error.
      title: CommonErrorNameMessageDetailsErrorDetails
    CommonErrorNameMessageDetailsError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
        details:
          $ref: '#/components/schemas/CommonErrorNameMessageDetailsErrorDetails'
          description: Information about the error.
      title: CommonErrorNameMessageDetailsError
    commonErrorNameMessageDetails:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorNameMessageDetailsError'
      title: commonErrorNameMessageDetails
    import400Error:
      oneOf:
        - $ref: '#/components/schemas/commonErrorNameMessage'
        - $ref: '#/components/schemas/commonErrorNameMessageDetails'
      title: import400Error
    CommonErrorTypeTitleDetailStatusType:
      oneOf:
        - type: string
          format: uri-reference
        - type: string
      title: CommonErrorTypeTitleDetailStatusType
    commonErrorTypeTitleDetailStatus:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailStatusType'
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: Information about the error.
        status:
          type: integer
          description: The error's HTTP status code.
      title: commonErrorTypeTitleDetailStatus
    ImportOpenApiDefinitionRequestUnauthorizedError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: ImportOpenApiDefinitionRequestUnauthorizedError
    CommonErrorTypeTitleDetailDetail:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      description: Information about the error.
      title: CommonErrorTypeTitleDetailDetail
    commonErrorTypeTitleDetail:
      type: object
      properties:
        type:
          type: string
          description: The type of error.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailDetail'
          description: Information about the error.
      title: commonErrorTypeTitleDetail
    ImportOpenApiDefinitionRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: ImportOpenApiDefinitionRequestInternalServerError
  securitySchemes:
    PostmanApiKey:
      type: apiKey
      in: header
      name: x-api-key
    scimApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        A valid [SCIM API
        key](https://learning.postman.com/docs/administration/scim-provisioning/scim-provisioning-overview/#generating-scim-api-key)
        for calls to SCIM endpoints.
    basicAuth:
      type: http
      scheme: basic

```

## Examples

### Import an OpenAPI (application/json)



**Request**

```json
{
  "input": "{\n  \"openapi\": \"3.0.0\",\n  \"servers\": [\n    {\n      \"url\": \"example.com\"\n    }\n  ],\n  \"info\": {\n    \"contact\": {\n      \"name\": \"Jon\"\n    },\n    \"version\": \"1.0.0\",\n    \"title\": \"Sample API\",\n    \"description\": \"Buy or rent spacecrafts\"\n  },\n  \"paths\": {\n    \"/spacecrafts/{spacecraftId}\": {\n      \"parameters\": [\n        {\n          \"name\": \"spacecraftId\",\n          \"description\": \"The unique identifier of the spacecraft\",\n          \"in\": \"path\",\n          \"required\": true,\n          \"schema\": {\n            \"$ref\": \"#/components/schemas/SpacecraftId\"\n          }\n        }\n      ],\n      \"get\": {\n        \"summary\": \"Read a spacecraft\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The spacecraft corresponding to the provided `spacecraftId`\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Spacecraft\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"No spacecraft found for the provided `spacecraftId`\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Error\"\n                }\n              }\n            }\n          },\n          \"500\": {\n            \"description\": \"Unexpected error\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Error\"\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  },\n  \"components\": {\n    \"schemas\": {\n      \"SpacecraftId\": {\n        \"description\": \"The unique identifier of a spacecraft\",\n        \"type\": \"string\"\n      },\n      \"Spacecraft\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\",\n          \"name\",\n          \"type\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"$ref\": \"#/components/schemas/SpacecraftId\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"type\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"capsule\",\n              \"probe\",\n              \"satellite\",\n              \"spaceplane\",\n              \"station\"\n            ]\n          },\n          \"description\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"Error\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"message\"\n        ],\n        \"properties\": {\n          \"message\": {\n            \"description\": \"A human readable error message\",\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"securitySchemes\": {\n      \"ApiKey\": {\n        \"type\": \"apiKey\",\n        \"in\": \"header\",\n        \"name\": \"X-Api-Key\"\n      }\n    }\n  },\n  \"security\": [\n    {\n      \"ApiKey\": []\n    }\n  ]\n}",
  "type": "string"
}
```

**Response**

```json
{
  "collections": [
    {
      "id": "12ece9e1-2abf-4edc-8e34-de66e74114d2",
      "name": "Sample API",
      "uid": "12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2"
    }
  ]
}
```

**SDK Code**

```python Import an OpenAPI (application/json)
import requests

url = "https://api.getpostman.com/import/openapi"

payload = {
    "input": "{
  \"openapi\": \"3.0.0\",
  \"servers\": [
    {
      \"url\": \"example.com\"
    }
  ],
  \"info\": {
    \"contact\": {
      \"name\": \"Jon\"
    },
    \"version\": \"1.0.0\",
    \"title\": \"Sample API\",
    \"description\": \"Buy or rent spacecrafts\"
  },
  \"paths\": {
    \"/spacecrafts/{spacecraftId}\": {
      \"parameters\": [
        {
          \"name\": \"spacecraftId\",
          \"description\": \"The unique identifier of the spacecraft\",
          \"in\": \"path\",
          \"required\": true,
          \"schema\": {
            \"$ref\": \"#/components/schemas/SpacecraftId\"
          }
        }
      ],
      \"get\": {
        \"summary\": \"Read a spacecraft\",
        \"responses\": {
          \"200\": {
            \"description\": \"The spacecraft corresponding to the provided `spacecraftId`\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Spacecraft\"
                }
              }
            }
          },
          \"404\": {
            \"description\": \"No spacecraft found for the provided `spacecraftId`\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Error\"
                }
              }
            }
          },
          \"500\": {
            \"description\": \"Unexpected error\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Error\"
                }
              }
            }
          }
        }
      }
    }
  },
  \"components\": {
    \"schemas\": {
      \"SpacecraftId\": {
        \"description\": \"The unique identifier of a spacecraft\",
        \"type\": \"string\"
      },
      \"Spacecraft\": {
        \"type\": \"object\",
        \"required\": [
          \"id\",
          \"name\",
          \"type\"
        ],
        \"properties\": {
          \"id\": {
            \"$ref\": \"#/components/schemas/SpacecraftId\"
          },
          \"name\": {
            \"type\": \"string\"
          },
          \"type\": {
            \"type\": \"string\",
            \"enum\": [
              \"capsule\",
              \"probe\",
              \"satellite\",
              \"spaceplane\",
              \"station\"
            ]
          },
          \"description\": {
            \"type\": \"string\"
          }
        }
      },
      \"Error\": {
        \"type\": \"object\",
        \"required\": [
          \"message\"
        ],
        \"properties\": {
          \"message\": {
            \"description\": \"A human readable error message\",
            \"type\": \"string\"
          }
        }
      }
    },
    \"securitySchemes\": {
      \"ApiKey\": {
        \"type\": \"apiKey\",
        \"in\": \"header\",
        \"name\": \"X-Api-Key\"
      }
    }
  },
  \"security\": [
    {
      \"ApiKey\": []
    }
  ]
}",
    "type": "string"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Import an OpenAPI (application/json)
const url = 'https://api.getpostman.com/import/openapi';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"input":"{\n  \"openapi\": \"3.0.0\",\n  \"servers\": [\n    {\n      \"url\": \"example.com\"\n    }\n  ],\n  \"info\": {\n    \"contact\": {\n      \"name\": \"Jon\"\n    },\n    \"version\": \"1.0.0\",\n    \"title\": \"Sample API\",\n    \"description\": \"Buy or rent spacecrafts\"\n  },\n  \"paths\": {\n    \"/spacecrafts/{spacecraftId}\": {\n      \"parameters\": [\n        {\n          \"name\": \"spacecraftId\",\n          \"description\": \"The unique identifier of the spacecraft\",\n          \"in\": \"path\",\n          \"required\": true,\n          \"schema\": {\n            \"$ref\": \"#/components/schemas/SpacecraftId\"\n          }\n        }\n      ],\n      \"get\": {\n        \"summary\": \"Read a spacecraft\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The spacecraft corresponding to the provided `spacecraftId`\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Spacecraft\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"No spacecraft found for the provided `spacecraftId`\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Error\"\n                }\n              }\n            }\n          },\n          \"500\": {\n            \"description\": \"Unexpected error\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Error\"\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  },\n  \"components\": {\n    \"schemas\": {\n      \"SpacecraftId\": {\n        \"description\": \"The unique identifier of a spacecraft\",\n        \"type\": \"string\"\n      },\n      \"Spacecraft\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\",\n          \"name\",\n          \"type\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"$ref\": \"#/components/schemas/SpacecraftId\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"type\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"capsule\",\n              \"probe\",\n              \"satellite\",\n              \"spaceplane\",\n              \"station\"\n            ]\n          },\n          \"description\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"Error\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"message\"\n        ],\n        \"properties\": {\n          \"message\": {\n            \"description\": \"A human readable error message\",\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"securitySchemes\": {\n      \"ApiKey\": {\n        \"type\": \"apiKey\",\n        \"in\": \"header\",\n        \"name\": \"X-Api-Key\"\n      }\n    }\n  },\n  \"security\": [\n    {\n      \"ApiKey\": []\n    }\n  ]\n}","type":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Import an OpenAPI (application/json)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/import/openapi"

	payload := strings.NewReader("{\n  \"input\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"servers\\\": [\\n    {\\n      \\\"url\\\": \\\"example.com\\\"\\n    }\\n  ],\\n  \\\"info\\\": {\\n    \\\"contact\\\": {\\n      \\\"name\\\": \\\"Jon\\\"\\n    },\\n    \\\"version\\\": \\\"1.0.0\\\",\\n    \\\"title\\\": \\\"Sample API\\\",\\n    \\\"description\\\": \\\"Buy or rent spacecrafts\\\"\\n  },\\n  \\\"paths\\\": {\\n    \\\"/spacecrafts/{spacecraftId}\\\": {\\n      \\\"parameters\\\": [\\n        {\\n          \\\"name\\\": \\\"spacecraftId\\\",\\n          \\\"description\\\": \\\"The unique identifier of the spacecraft\\\",\\n          \\\"in\\\": \\\"path\\\",\\n          \\\"required\\\": true,\\n          \\\"schema\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          }\\n        }\\n      ],\\n      \\\"get\\\": {\\n        \\\"summary\\\": \\\"Read a spacecraft\\\",\\n        \\\"responses\\\": {\\n          \\\"200\\\": {\\n            \\\"description\\\": \\\"The spacecraft corresponding to the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Spacecraft\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"404\\\": {\\n            \\\"description\\\": \\\"No spacecraft found for the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"500\\\": {\\n            \\\"description\\\": \\\"Unexpected error\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          }\\n        }\\n      }\\n    }\\n  },\\n  \\\"components\\\": {\\n    \\\"schemas\\\": {\\n      \\\"SpacecraftId\\\": {\\n        \\\"description\\\": \\\"The unique identifier of a spacecraft\\\",\\n        \\\"type\\\": \\\"string\\\"\\n      },\\n      \\\"Spacecraft\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"id\\\",\\n          \\\"name\\\",\\n          \\\"type\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"id\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          },\\n          \\\"name\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          },\\n          \\\"type\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"enum\\\": [\\n              \\\"capsule\\\",\\n              \\\"probe\\\",\\n              \\\"satellite\\\",\\n              \\\"spaceplane\\\",\\n              \\\"station\\\"\\n            ]\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      },\\n      \\\"Error\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"message\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"message\\\": {\\n            \\\"description\\\": \\\"A human readable error message\\\",\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      }\\n    },\\n    \\\"securitySchemes\\\": {\\n      \\\"ApiKey\\\": {\\n        \\\"type\\\": \\\"apiKey\\\",\\n        \\\"in\\\": \\\"header\\\",\\n        \\\"name\\\": \\\"X-Api-Key\\\"\\n      }\\n    }\\n  },\\n  \\\"security\\\": [\\n    {\\n      \\\"ApiKey\\\": []\\n    }\\n  ]\\n}\",\n  \"type\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Import an OpenAPI (application/json)
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/import/openapi")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"input\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"servers\\\": [\\n    {\\n      \\\"url\\\": \\\"example.com\\\"\\n    }\\n  ],\\n  \\\"info\\\": {\\n    \\\"contact\\\": {\\n      \\\"name\\\": \\\"Jon\\\"\\n    },\\n    \\\"version\\\": \\\"1.0.0\\\",\\n    \\\"title\\\": \\\"Sample API\\\",\\n    \\\"description\\\": \\\"Buy or rent spacecrafts\\\"\\n  },\\n  \\\"paths\\\": {\\n    \\\"/spacecrafts/{spacecraftId}\\\": {\\n      \\\"parameters\\\": [\\n        {\\n          \\\"name\\\": \\\"spacecraftId\\\",\\n          \\\"description\\\": \\\"The unique identifier of the spacecraft\\\",\\n          \\\"in\\\": \\\"path\\\",\\n          \\\"required\\\": true,\\n          \\\"schema\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          }\\n        }\\n      ],\\n      \\\"get\\\": {\\n        \\\"summary\\\": \\\"Read a spacecraft\\\",\\n        \\\"responses\\\": {\\n          \\\"200\\\": {\\n            \\\"description\\\": \\\"The spacecraft corresponding to the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Spacecraft\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"404\\\": {\\n            \\\"description\\\": \\\"No spacecraft found for the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"500\\\": {\\n            \\\"description\\\": \\\"Unexpected error\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          }\\n        }\\n      }\\n    }\\n  },\\n  \\\"components\\\": {\\n    \\\"schemas\\\": {\\n      \\\"SpacecraftId\\\": {\\n        \\\"description\\\": \\\"The unique identifier of a spacecraft\\\",\\n        \\\"type\\\": \\\"string\\\"\\n      },\\n      \\\"Spacecraft\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"id\\\",\\n          \\\"name\\\",\\n          \\\"type\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"id\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          },\\n          \\\"name\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          },\\n          \\\"type\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"enum\\\": [\\n              \\\"capsule\\\",\\n              \\\"probe\\\",\\n              \\\"satellite\\\",\\n              \\\"spaceplane\\\",\\n              \\\"station\\\"\\n            ]\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      },\\n      \\\"Error\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"message\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"message\\\": {\\n            \\\"description\\\": \\\"A human readable error message\\\",\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      }\\n    },\\n    \\\"securitySchemes\\\": {\\n      \\\"ApiKey\\\": {\\n        \\\"type\\\": \\\"apiKey\\\",\\n        \\\"in\\\": \\\"header\\\",\\n        \\\"name\\\": \\\"X-Api-Key\\\"\\n      }\\n    }\\n  },\\n  \\\"security\\\": [\\n    {\\n      \\\"ApiKey\\\": []\\n    }\\n  ]\\n}\",\n  \"type\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java Import an OpenAPI (application/json)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/import/openapi")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"input\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"servers\\\": [\\n    {\\n      \\\"url\\\": \\\"example.com\\\"\\n    }\\n  ],\\n  \\\"info\\\": {\\n    \\\"contact\\\": {\\n      \\\"name\\\": \\\"Jon\\\"\\n    },\\n    \\\"version\\\": \\\"1.0.0\\\",\\n    \\\"title\\\": \\\"Sample API\\\",\\n    \\\"description\\\": \\\"Buy or rent spacecrafts\\\"\\n  },\\n  \\\"paths\\\": {\\n    \\\"/spacecrafts/{spacecraftId}\\\": {\\n      \\\"parameters\\\": [\\n        {\\n          \\\"name\\\": \\\"spacecraftId\\\",\\n          \\\"description\\\": \\\"The unique identifier of the spacecraft\\\",\\n          \\\"in\\\": \\\"path\\\",\\n          \\\"required\\\": true,\\n          \\\"schema\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          }\\n        }\\n      ],\\n      \\\"get\\\": {\\n        \\\"summary\\\": \\\"Read a spacecraft\\\",\\n        \\\"responses\\\": {\\n          \\\"200\\\": {\\n            \\\"description\\\": \\\"The spacecraft corresponding to the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Spacecraft\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"404\\\": {\\n            \\\"description\\\": \\\"No spacecraft found for the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"500\\\": {\\n            \\\"description\\\": \\\"Unexpected error\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          }\\n        }\\n      }\\n    }\\n  },\\n  \\\"components\\\": {\\n    \\\"schemas\\\": {\\n      \\\"SpacecraftId\\\": {\\n        \\\"description\\\": \\\"The unique identifier of a spacecraft\\\",\\n        \\\"type\\\": \\\"string\\\"\\n      },\\n      \\\"Spacecraft\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"id\\\",\\n          \\\"name\\\",\\n          \\\"type\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"id\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          },\\n          \\\"name\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          },\\n          \\\"type\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"enum\\\": [\\n              \\\"capsule\\\",\\n              \\\"probe\\\",\\n              \\\"satellite\\\",\\n              \\\"spaceplane\\\",\\n              \\\"station\\\"\\n            ]\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      },\\n      \\\"Error\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"message\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"message\\\": {\\n            \\\"description\\\": \\\"A human readable error message\\\",\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      }\\n    },\\n    \\\"securitySchemes\\\": {\\n      \\\"ApiKey\\\": {\\n        \\\"type\\\": \\\"apiKey\\\",\\n        \\\"in\\\": \\\"header\\\",\\n        \\\"name\\\": \\\"X-Api-Key\\\"\\n      }\\n    }\\n  },\\n  \\\"security\\\": [\\n    {\\n      \\\"ApiKey\\\": []\\n    }\\n  ]\\n}\",\n  \"type\": \"string\"\n}")
  .asString();
```

```php Import an OpenAPI (application/json)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/import/openapi', [
  'body' => '{
  "input": "{\\n  \\"openapi\\": \\"3.0.0\\",\\n  \\"servers\\": [\\n    {\\n      \\"url\\": \\"example.com\\"\\n    }\\n  ],\\n  \\"info\\": {\\n    \\"contact\\": {\\n      \\"name\\": \\"Jon\\"\\n    },\\n    \\"version\\": \\"1.0.0\\",\\n    \\"title\\": \\"Sample API\\",\\n    \\"description\\": \\"Buy or rent spacecrafts\\"\\n  },\\n  \\"paths\\": {\\n    \\"/spacecrafts/{spacecraftId}\\": {\\n      \\"parameters\\": [\\n        {\\n          \\"name\\": \\"spacecraftId\\",\\n          \\"description\\": \\"The unique identifier of the spacecraft\\",\\n          \\"in\\": \\"path\\",\\n          \\"required\\": true,\\n          \\"schema\\": {\\n            \\"$ref\\": \\"#/components/schemas/SpacecraftId\\"\\n          }\\n        }\\n      ],\\n      \\"get\\": {\\n        \\"summary\\": \\"Read a spacecraft\\",\\n        \\"responses\\": {\\n          \\"200\\": {\\n            \\"description\\": \\"The spacecraft corresponding to the provided `spacecraftId`\\",\\n            \\"content\\": {\\n              \\"application/json\\": {\\n                \\"schema\\": {\\n                  \\"$ref\\": \\"#/components/schemas/Spacecraft\\"\\n                }\\n              }\\n            }\\n          },\\n          \\"404\\": {\\n            \\"description\\": \\"No spacecraft found for the provided `spacecraftId`\\",\\n            \\"content\\": {\\n              \\"application/json\\": {\\n                \\"schema\\": {\\n                  \\"$ref\\": \\"#/components/schemas/Error\\"\\n                }\\n              }\\n            }\\n          },\\n          \\"500\\": {\\n            \\"description\\": \\"Unexpected error\\",\\n            \\"content\\": {\\n              \\"application/json\\": {\\n                \\"schema\\": {\\n                  \\"$ref\\": \\"#/components/schemas/Error\\"\\n                }\\n              }\\n            }\\n          }\\n        }\\n      }\\n    }\\n  },\\n  \\"components\\": {\\n    \\"schemas\\": {\\n      \\"SpacecraftId\\": {\\n        \\"description\\": \\"The unique identifier of a spacecraft\\",\\n        \\"type\\": \\"string\\"\\n      },\\n      \\"Spacecraft\\": {\\n        \\"type\\": \\"object\\",\\n        \\"required\\": [\\n          \\"id\\",\\n          \\"name\\",\\n          \\"type\\"\\n        ],\\n        \\"properties\\": {\\n          \\"id\\": {\\n            \\"$ref\\": \\"#/components/schemas/SpacecraftId\\"\\n          },\\n          \\"name\\": {\\n            \\"type\\": \\"string\\"\\n          },\\n          \\"type\\": {\\n            \\"type\\": \\"string\\",\\n            \\"enum\\": [\\n              \\"capsule\\",\\n              \\"probe\\",\\n              \\"satellite\\",\\n              \\"spaceplane\\",\\n              \\"station\\"\\n            ]\\n          },\\n          \\"description\\": {\\n            \\"type\\": \\"string\\"\\n          }\\n        }\\n      },\\n      \\"Error\\": {\\n        \\"type\\": \\"object\\",\\n        \\"required\\": [\\n          \\"message\\"\\n        ],\\n        \\"properties\\": {\\n          \\"message\\": {\\n            \\"description\\": \\"A human readable error message\\",\\n            \\"type\\": \\"string\\"\\n          }\\n        }\\n      }\\n    },\\n    \\"securitySchemes\\": {\\n      \\"ApiKey\\": {\\n        \\"type\\": \\"apiKey\\",\\n        \\"in\\": \\"header\\",\\n        \\"name\\": \\"X-Api-Key\\"\\n      }\\n    }\\n  },\\n  \\"security\\": [\\n    {\\n      \\"ApiKey\\": []\\n    }\\n  ]\\n}",
  "type": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Import an OpenAPI (application/json)
using RestSharp;

var client = new RestClient("https://api.getpostman.com/import/openapi");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"input\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"servers\\\": [\\n    {\\n      \\\"url\\\": \\\"example.com\\\"\\n    }\\n  ],\\n  \\\"info\\\": {\\n    \\\"contact\\\": {\\n      \\\"name\\\": \\\"Jon\\\"\\n    },\\n    \\\"version\\\": \\\"1.0.0\\\",\\n    \\\"title\\\": \\\"Sample API\\\",\\n    \\\"description\\\": \\\"Buy or rent spacecrafts\\\"\\n  },\\n  \\\"paths\\\": {\\n    \\\"/spacecrafts/{spacecraftId}\\\": {\\n      \\\"parameters\\\": [\\n        {\\n          \\\"name\\\": \\\"spacecraftId\\\",\\n          \\\"description\\\": \\\"The unique identifier of the spacecraft\\\",\\n          \\\"in\\\": \\\"path\\\",\\n          \\\"required\\\": true,\\n          \\\"schema\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          }\\n        }\\n      ],\\n      \\\"get\\\": {\\n        \\\"summary\\\": \\\"Read a spacecraft\\\",\\n        \\\"responses\\\": {\\n          \\\"200\\\": {\\n            \\\"description\\\": \\\"The spacecraft corresponding to the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Spacecraft\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"404\\\": {\\n            \\\"description\\\": \\\"No spacecraft found for the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"500\\\": {\\n            \\\"description\\\": \\\"Unexpected error\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          }\\n        }\\n      }\\n    }\\n  },\\n  \\\"components\\\": {\\n    \\\"schemas\\\": {\\n      \\\"SpacecraftId\\\": {\\n        \\\"description\\\": \\\"The unique identifier of a spacecraft\\\",\\n        \\\"type\\\": \\\"string\\\"\\n      },\\n      \\\"Spacecraft\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"id\\\",\\n          \\\"name\\\",\\n          \\\"type\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"id\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          },\\n          \\\"name\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          },\\n          \\\"type\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"enum\\\": [\\n              \\\"capsule\\\",\\n              \\\"probe\\\",\\n              \\\"satellite\\\",\\n              \\\"spaceplane\\\",\\n              \\\"station\\\"\\n            ]\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      },\\n      \\\"Error\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"message\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"message\\\": {\\n            \\\"description\\\": \\\"A human readable error message\\\",\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      }\\n    },\\n    \\\"securitySchemes\\\": {\\n      \\\"ApiKey\\\": {\\n        \\\"type\\\": \\\"apiKey\\\",\\n        \\\"in\\\": \\\"header\\\",\\n        \\\"name\\\": \\\"X-Api-Key\\\"\\n      }\\n    }\\n  },\\n  \\\"security\\\": [\\n    {\\n      \\\"ApiKey\\\": []\\n    }\\n  ]\\n}\",\n  \"type\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Import an OpenAPI (application/json)
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "input": "{
  \"openapi\": \"3.0.0\",
  \"servers\": [
    {
      \"url\": \"example.com\"
    }
  ],
  \"info\": {
    \"contact\": {
      \"name\": \"Jon\"
    },
    \"version\": \"1.0.0\",
    \"title\": \"Sample API\",
    \"description\": \"Buy or rent spacecrafts\"
  },
  \"paths\": {
    \"/spacecrafts/{spacecraftId}\": {
      \"parameters\": [
        {
          \"name\": \"spacecraftId\",
          \"description\": \"The unique identifier of the spacecraft\",
          \"in\": \"path\",
          \"required\": true,
          \"schema\": {
            \"$ref\": \"#/components/schemas/SpacecraftId\"
          }
        }
      ],
      \"get\": {
        \"summary\": \"Read a spacecraft\",
        \"responses\": {
          \"200\": {
            \"description\": \"The spacecraft corresponding to the provided `spacecraftId`\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Spacecraft\"
                }
              }
            }
          },
          \"404\": {
            \"description\": \"No spacecraft found for the provided `spacecraftId`\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Error\"
                }
              }
            }
          },
          \"500\": {
            \"description\": \"Unexpected error\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Error\"
                }
              }
            }
          }
        }
      }
    }
  },
  \"components\": {
    \"schemas\": {
      \"SpacecraftId\": {
        \"description\": \"The unique identifier of a spacecraft\",
        \"type\": \"string\"
      },
      \"Spacecraft\": {
        \"type\": \"object\",
        \"required\": [
          \"id\",
          \"name\",
          \"type\"
        ],
        \"properties\": {
          \"id\": {
            \"$ref\": \"#/components/schemas/SpacecraftId\"
          },
          \"name\": {
            \"type\": \"string\"
          },
          \"type\": {
            \"type\": \"string\",
            \"enum\": [
              \"capsule\",
              \"probe\",
              \"satellite\",
              \"spaceplane\",
              \"station\"
            ]
          },
          \"description\": {
            \"type\": \"string\"
          }
        }
      },
      \"Error\": {
        \"type\": \"object\",
        \"required\": [
          \"message\"
        ],
        \"properties\": {
          \"message\": {
            \"description\": \"A human readable error message\",
            \"type\": \"string\"
          }
        }
      }
    },
    \"securitySchemes\": {
      \"ApiKey\": {
        \"type\": \"apiKey\",
        \"in\": \"header\",
        \"name\": \"X-Api-Key\"
      }
    }
  },
  \"security\": [
    {
      \"ApiKey\": []
    }
  ]
}",
  "type": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/import/openapi")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Import an OpenAPI Definition with Options (application/json)



**Request**

```json
{
  "input": "{\n  \"openapi\": \"3.0.0\",\n  \"servers\": [\n    {\n      \"url\": \"example.com\"\n    }\n  ],\n  \"info\": {\n    \"contact\": {\n      \"name\": \"Jon\"\n    },\n    \"version\": \"1.0.0\",\n    \"title\": \"Sample API\",\n    \"description\": \"Buy or rent spacecrafts\"\n  },\n  \"paths\": {\n    \"/spacecrafts/{spacecraftId}\": {\n      \"parameters\": [\n        {\n          \"name\": \"spacecraftId\",\n          \"description\": \"The unique identifier of the spacecraft\",\n          \"in\": \"path\",\n          \"required\": true,\n          \"schema\": {\n            \"$ref\": \"#/components/schemas/SpacecraftId\"\n          }\n        }\n      ],\n      \"get\": {\n        \"summary\": \"Read a spacecraft\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The spacecraft corresponding to the provided `spacecraftId`\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Spacecraft\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"No spacecraft found for the provided `spacecraftId`\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Error\"\n                }\n              }\n            }\n          },\n          \"500\": {\n            \"description\": \"Unexpected error\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Error\"\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  },\n  \"components\": {\n    \"schemas\": {\n      \"SpacecraftId\": {\n        \"description\": \"The unique identifier of a spacecraft\",\n        \"type\": \"string\"\n      },\n      \"Spacecraft\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\",\n          \"name\",\n          \"type\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"$ref\": \"#/components/schemas/SpacecraftId\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"type\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"capsule\",\n              \"probe\",\n              \"satellite\",\n              \"spaceplane\",\n              \"station\"\n            ]\n          },\n          \"description\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"Error\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"message\"\n        ],\n        \"properties\": {\n          \"message\": {\n            \"description\": \"A human readable error message\",\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"securitySchemes\": {\n      \"ApiKey\": {\n        \"type\": \"apiKey\",\n        \"in\": \"header\",\n        \"name\": \"X-Api-Key\"\n      }\n    }\n  },\n  \"security\": [\n    {\n      \"ApiKey\": []\n    }\n  ]\n}",
  "options": {
    "disableOptionalParameters": true,
    "exampleParametersResolution": "Schema",
    "folderStrategy": "Paths"
  },
  "type": "string"
}
```

**Response**

```json
{
  "collections": [
    {
      "id": "12ece9e1-2abf-4edc-8e34-de66e74114d2",
      "name": "Sample API",
      "uid": "12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2"
    }
  ]
}
```

**SDK Code**

```python Import an OpenAPI Definition with Options (application/json)
import requests

url = "https://api.getpostman.com/import/openapi"

payload = {
    "input": "{
  \"openapi\": \"3.0.0\",
  \"servers\": [
    {
      \"url\": \"example.com\"
    }
  ],
  \"info\": {
    \"contact\": {
      \"name\": \"Jon\"
    },
    \"version\": \"1.0.0\",
    \"title\": \"Sample API\",
    \"description\": \"Buy or rent spacecrafts\"
  },
  \"paths\": {
    \"/spacecrafts/{spacecraftId}\": {
      \"parameters\": [
        {
          \"name\": \"spacecraftId\",
          \"description\": \"The unique identifier of the spacecraft\",
          \"in\": \"path\",
          \"required\": true,
          \"schema\": {
            \"$ref\": \"#/components/schemas/SpacecraftId\"
          }
        }
      ],
      \"get\": {
        \"summary\": \"Read a spacecraft\",
        \"responses\": {
          \"200\": {
            \"description\": \"The spacecraft corresponding to the provided `spacecraftId`\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Spacecraft\"
                }
              }
            }
          },
          \"404\": {
            \"description\": \"No spacecraft found for the provided `spacecraftId`\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Error\"
                }
              }
            }
          },
          \"500\": {
            \"description\": \"Unexpected error\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Error\"
                }
              }
            }
          }
        }
      }
    }
  },
  \"components\": {
    \"schemas\": {
      \"SpacecraftId\": {
        \"description\": \"The unique identifier of a spacecraft\",
        \"type\": \"string\"
      },
      \"Spacecraft\": {
        \"type\": \"object\",
        \"required\": [
          \"id\",
          \"name\",
          \"type\"
        ],
        \"properties\": {
          \"id\": {
            \"$ref\": \"#/components/schemas/SpacecraftId\"
          },
          \"name\": {
            \"type\": \"string\"
          },
          \"type\": {
            \"type\": \"string\",
            \"enum\": [
              \"capsule\",
              \"probe\",
              \"satellite\",
              \"spaceplane\",
              \"station\"
            ]
          },
          \"description\": {
            \"type\": \"string\"
          }
        }
      },
      \"Error\": {
        \"type\": \"object\",
        \"required\": [
          \"message\"
        ],
        \"properties\": {
          \"message\": {
            \"description\": \"A human readable error message\",
            \"type\": \"string\"
          }
        }
      }
    },
    \"securitySchemes\": {
      \"ApiKey\": {
        \"type\": \"apiKey\",
        \"in\": \"header\",
        \"name\": \"X-Api-Key\"
      }
    }
  },
  \"security\": [
    {
      \"ApiKey\": []
    }
  ]
}",
    "options": {
        "disableOptionalParameters": True,
        "exampleParametersResolution": "Schema",
        "folderStrategy": "Paths"
    },
    "type": "string"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Import an OpenAPI Definition with Options (application/json)
const url = 'https://api.getpostman.com/import/openapi';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"input":"{\n  \"openapi\": \"3.0.0\",\n  \"servers\": [\n    {\n      \"url\": \"example.com\"\n    }\n  ],\n  \"info\": {\n    \"contact\": {\n      \"name\": \"Jon\"\n    },\n    \"version\": \"1.0.0\",\n    \"title\": \"Sample API\",\n    \"description\": \"Buy or rent spacecrafts\"\n  },\n  \"paths\": {\n    \"/spacecrafts/{spacecraftId}\": {\n      \"parameters\": [\n        {\n          \"name\": \"spacecraftId\",\n          \"description\": \"The unique identifier of the spacecraft\",\n          \"in\": \"path\",\n          \"required\": true,\n          \"schema\": {\n            \"$ref\": \"#/components/schemas/SpacecraftId\"\n          }\n        }\n      ],\n      \"get\": {\n        \"summary\": \"Read a spacecraft\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"The spacecraft corresponding to the provided `spacecraftId`\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Spacecraft\"\n                }\n              }\n            }\n          },\n          \"404\": {\n            \"description\": \"No spacecraft found for the provided `spacecraftId`\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Error\"\n                }\n              }\n            }\n          },\n          \"500\": {\n            \"description\": \"Unexpected error\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/Error\"\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  },\n  \"components\": {\n    \"schemas\": {\n      \"SpacecraftId\": {\n        \"description\": \"The unique identifier of a spacecraft\",\n        \"type\": \"string\"\n      },\n      \"Spacecraft\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"id\",\n          \"name\",\n          \"type\"\n        ],\n        \"properties\": {\n          \"id\": {\n            \"$ref\": \"#/components/schemas/SpacecraftId\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"type\": {\n            \"type\": \"string\",\n            \"enum\": [\n              \"capsule\",\n              \"probe\",\n              \"satellite\",\n              \"spaceplane\",\n              \"station\"\n            ]\n          },\n          \"description\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"Error\": {\n        \"type\": \"object\",\n        \"required\": [\n          \"message\"\n        ],\n        \"properties\": {\n          \"message\": {\n            \"description\": \"A human readable error message\",\n            \"type\": \"string\"\n          }\n        }\n      }\n    },\n    \"securitySchemes\": {\n      \"ApiKey\": {\n        \"type\": \"apiKey\",\n        \"in\": \"header\",\n        \"name\": \"X-Api-Key\"\n      }\n    }\n  },\n  \"security\": [\n    {\n      \"ApiKey\": []\n    }\n  ]\n}","options":{"disableOptionalParameters":true,"exampleParametersResolution":"Schema","folderStrategy":"Paths"},"type":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Import an OpenAPI Definition with Options (application/json)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/import/openapi"

	payload := strings.NewReader("{\n  \"input\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"servers\\\": [\\n    {\\n      \\\"url\\\": \\\"example.com\\\"\\n    }\\n  ],\\n  \\\"info\\\": {\\n    \\\"contact\\\": {\\n      \\\"name\\\": \\\"Jon\\\"\\n    },\\n    \\\"version\\\": \\\"1.0.0\\\",\\n    \\\"title\\\": \\\"Sample API\\\",\\n    \\\"description\\\": \\\"Buy or rent spacecrafts\\\"\\n  },\\n  \\\"paths\\\": {\\n    \\\"/spacecrafts/{spacecraftId}\\\": {\\n      \\\"parameters\\\": [\\n        {\\n          \\\"name\\\": \\\"spacecraftId\\\",\\n          \\\"description\\\": \\\"The unique identifier of the spacecraft\\\",\\n          \\\"in\\\": \\\"path\\\",\\n          \\\"required\\\": true,\\n          \\\"schema\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          }\\n        }\\n      ],\\n      \\\"get\\\": {\\n        \\\"summary\\\": \\\"Read a spacecraft\\\",\\n        \\\"responses\\\": {\\n          \\\"200\\\": {\\n            \\\"description\\\": \\\"The spacecraft corresponding to the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Spacecraft\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"404\\\": {\\n            \\\"description\\\": \\\"No spacecraft found for the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"500\\\": {\\n            \\\"description\\\": \\\"Unexpected error\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          }\\n        }\\n      }\\n    }\\n  },\\n  \\\"components\\\": {\\n    \\\"schemas\\\": {\\n      \\\"SpacecraftId\\\": {\\n        \\\"description\\\": \\\"The unique identifier of a spacecraft\\\",\\n        \\\"type\\\": \\\"string\\\"\\n      },\\n      \\\"Spacecraft\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"id\\\",\\n          \\\"name\\\",\\n          \\\"type\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"id\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          },\\n          \\\"name\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          },\\n          \\\"type\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"enum\\\": [\\n              \\\"capsule\\\",\\n              \\\"probe\\\",\\n              \\\"satellite\\\",\\n              \\\"spaceplane\\\",\\n              \\\"station\\\"\\n            ]\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      },\\n      \\\"Error\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"message\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"message\\\": {\\n            \\\"description\\\": \\\"A human readable error message\\\",\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      }\\n    },\\n    \\\"securitySchemes\\\": {\\n      \\\"ApiKey\\\": {\\n        \\\"type\\\": \\\"apiKey\\\",\\n        \\\"in\\\": \\\"header\\\",\\n        \\\"name\\\": \\\"X-Api-Key\\\"\\n      }\\n    }\\n  },\\n  \\\"security\\\": [\\n    {\\n      \\\"ApiKey\\\": []\\n    }\\n  ]\\n}\",\n  \"options\": {\n    \"disableOptionalParameters\": true,\n    \"exampleParametersResolution\": \"Schema\",\n    \"folderStrategy\": \"Paths\"\n  },\n  \"type\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Import an OpenAPI Definition with Options (application/json)
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/import/openapi")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"input\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"servers\\\": [\\n    {\\n      \\\"url\\\": \\\"example.com\\\"\\n    }\\n  ],\\n  \\\"info\\\": {\\n    \\\"contact\\\": {\\n      \\\"name\\\": \\\"Jon\\\"\\n    },\\n    \\\"version\\\": \\\"1.0.0\\\",\\n    \\\"title\\\": \\\"Sample API\\\",\\n    \\\"description\\\": \\\"Buy or rent spacecrafts\\\"\\n  },\\n  \\\"paths\\\": {\\n    \\\"/spacecrafts/{spacecraftId}\\\": {\\n      \\\"parameters\\\": [\\n        {\\n          \\\"name\\\": \\\"spacecraftId\\\",\\n          \\\"description\\\": \\\"The unique identifier of the spacecraft\\\",\\n          \\\"in\\\": \\\"path\\\",\\n          \\\"required\\\": true,\\n          \\\"schema\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          }\\n        }\\n      ],\\n      \\\"get\\\": {\\n        \\\"summary\\\": \\\"Read a spacecraft\\\",\\n        \\\"responses\\\": {\\n          \\\"200\\\": {\\n            \\\"description\\\": \\\"The spacecraft corresponding to the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Spacecraft\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"404\\\": {\\n            \\\"description\\\": \\\"No spacecraft found for the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"500\\\": {\\n            \\\"description\\\": \\\"Unexpected error\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          }\\n        }\\n      }\\n    }\\n  },\\n  \\\"components\\\": {\\n    \\\"schemas\\\": {\\n      \\\"SpacecraftId\\\": {\\n        \\\"description\\\": \\\"The unique identifier of a spacecraft\\\",\\n        \\\"type\\\": \\\"string\\\"\\n      },\\n      \\\"Spacecraft\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"id\\\",\\n          \\\"name\\\",\\n          \\\"type\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"id\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          },\\n          \\\"name\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          },\\n          \\\"type\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"enum\\\": [\\n              \\\"capsule\\\",\\n              \\\"probe\\\",\\n              \\\"satellite\\\",\\n              \\\"spaceplane\\\",\\n              \\\"station\\\"\\n            ]\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      },\\n      \\\"Error\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"message\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"message\\\": {\\n            \\\"description\\\": \\\"A human readable error message\\\",\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      }\\n    },\\n    \\\"securitySchemes\\\": {\\n      \\\"ApiKey\\\": {\\n        \\\"type\\\": \\\"apiKey\\\",\\n        \\\"in\\\": \\\"header\\\",\\n        \\\"name\\\": \\\"X-Api-Key\\\"\\n      }\\n    }\\n  },\\n  \\\"security\\\": [\\n    {\\n      \\\"ApiKey\\\": []\\n    }\\n  ]\\n}\",\n  \"options\": {\n    \"disableOptionalParameters\": true,\n    \"exampleParametersResolution\": \"Schema\",\n    \"folderStrategy\": \"Paths\"\n  },\n  \"type\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java Import an OpenAPI Definition with Options (application/json)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/import/openapi")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"input\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"servers\\\": [\\n    {\\n      \\\"url\\\": \\\"example.com\\\"\\n    }\\n  ],\\n  \\\"info\\\": {\\n    \\\"contact\\\": {\\n      \\\"name\\\": \\\"Jon\\\"\\n    },\\n    \\\"version\\\": \\\"1.0.0\\\",\\n    \\\"title\\\": \\\"Sample API\\\",\\n    \\\"description\\\": \\\"Buy or rent spacecrafts\\\"\\n  },\\n  \\\"paths\\\": {\\n    \\\"/spacecrafts/{spacecraftId}\\\": {\\n      \\\"parameters\\\": [\\n        {\\n          \\\"name\\\": \\\"spacecraftId\\\",\\n          \\\"description\\\": \\\"The unique identifier of the spacecraft\\\",\\n          \\\"in\\\": \\\"path\\\",\\n          \\\"required\\\": true,\\n          \\\"schema\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          }\\n        }\\n      ],\\n      \\\"get\\\": {\\n        \\\"summary\\\": \\\"Read a spacecraft\\\",\\n        \\\"responses\\\": {\\n          \\\"200\\\": {\\n            \\\"description\\\": \\\"The spacecraft corresponding to the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Spacecraft\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"404\\\": {\\n            \\\"description\\\": \\\"No spacecraft found for the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"500\\\": {\\n            \\\"description\\\": \\\"Unexpected error\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          }\\n        }\\n      }\\n    }\\n  },\\n  \\\"components\\\": {\\n    \\\"schemas\\\": {\\n      \\\"SpacecraftId\\\": {\\n        \\\"description\\\": \\\"The unique identifier of a spacecraft\\\",\\n        \\\"type\\\": \\\"string\\\"\\n      },\\n      \\\"Spacecraft\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"id\\\",\\n          \\\"name\\\",\\n          \\\"type\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"id\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          },\\n          \\\"name\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          },\\n          \\\"type\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"enum\\\": [\\n              \\\"capsule\\\",\\n              \\\"probe\\\",\\n              \\\"satellite\\\",\\n              \\\"spaceplane\\\",\\n              \\\"station\\\"\\n            ]\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      },\\n      \\\"Error\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"message\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"message\\\": {\\n            \\\"description\\\": \\\"A human readable error message\\\",\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      }\\n    },\\n    \\\"securitySchemes\\\": {\\n      \\\"ApiKey\\\": {\\n        \\\"type\\\": \\\"apiKey\\\",\\n        \\\"in\\\": \\\"header\\\",\\n        \\\"name\\\": \\\"X-Api-Key\\\"\\n      }\\n    }\\n  },\\n  \\\"security\\\": [\\n    {\\n      \\\"ApiKey\\\": []\\n    }\\n  ]\\n}\",\n  \"options\": {\n    \"disableOptionalParameters\": true,\n    \"exampleParametersResolution\": \"Schema\",\n    \"folderStrategy\": \"Paths\"\n  },\n  \"type\": \"string\"\n}")
  .asString();
```

```php Import an OpenAPI Definition with Options (application/json)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/import/openapi', [
  'body' => '{
  "input": "{\\n  \\"openapi\\": \\"3.0.0\\",\\n  \\"servers\\": [\\n    {\\n      \\"url\\": \\"example.com\\"\\n    }\\n  ],\\n  \\"info\\": {\\n    \\"contact\\": {\\n      \\"name\\": \\"Jon\\"\\n    },\\n    \\"version\\": \\"1.0.0\\",\\n    \\"title\\": \\"Sample API\\",\\n    \\"description\\": \\"Buy or rent spacecrafts\\"\\n  },\\n  \\"paths\\": {\\n    \\"/spacecrafts/{spacecraftId}\\": {\\n      \\"parameters\\": [\\n        {\\n          \\"name\\": \\"spacecraftId\\",\\n          \\"description\\": \\"The unique identifier of the spacecraft\\",\\n          \\"in\\": \\"path\\",\\n          \\"required\\": true,\\n          \\"schema\\": {\\n            \\"$ref\\": \\"#/components/schemas/SpacecraftId\\"\\n          }\\n        }\\n      ],\\n      \\"get\\": {\\n        \\"summary\\": \\"Read a spacecraft\\",\\n        \\"responses\\": {\\n          \\"200\\": {\\n            \\"description\\": \\"The spacecraft corresponding to the provided `spacecraftId`\\",\\n            \\"content\\": {\\n              \\"application/json\\": {\\n                \\"schema\\": {\\n                  \\"$ref\\": \\"#/components/schemas/Spacecraft\\"\\n                }\\n              }\\n            }\\n          },\\n          \\"404\\": {\\n            \\"description\\": \\"No spacecraft found for the provided `spacecraftId`\\",\\n            \\"content\\": {\\n              \\"application/json\\": {\\n                \\"schema\\": {\\n                  \\"$ref\\": \\"#/components/schemas/Error\\"\\n                }\\n              }\\n            }\\n          },\\n          \\"500\\": {\\n            \\"description\\": \\"Unexpected error\\",\\n            \\"content\\": {\\n              \\"application/json\\": {\\n                \\"schema\\": {\\n                  \\"$ref\\": \\"#/components/schemas/Error\\"\\n                }\\n              }\\n            }\\n          }\\n        }\\n      }\\n    }\\n  },\\n  \\"components\\": {\\n    \\"schemas\\": {\\n      \\"SpacecraftId\\": {\\n        \\"description\\": \\"The unique identifier of a spacecraft\\",\\n        \\"type\\": \\"string\\"\\n      },\\n      \\"Spacecraft\\": {\\n        \\"type\\": \\"object\\",\\n        \\"required\\": [\\n          \\"id\\",\\n          \\"name\\",\\n          \\"type\\"\\n        ],\\n        \\"properties\\": {\\n          \\"id\\": {\\n            \\"$ref\\": \\"#/components/schemas/SpacecraftId\\"\\n          },\\n          \\"name\\": {\\n            \\"type\\": \\"string\\"\\n          },\\n          \\"type\\": {\\n            \\"type\\": \\"string\\",\\n            \\"enum\\": [\\n              \\"capsule\\",\\n              \\"probe\\",\\n              \\"satellite\\",\\n              \\"spaceplane\\",\\n              \\"station\\"\\n            ]\\n          },\\n          \\"description\\": {\\n            \\"type\\": \\"string\\"\\n          }\\n        }\\n      },\\n      \\"Error\\": {\\n        \\"type\\": \\"object\\",\\n        \\"required\\": [\\n          \\"message\\"\\n        ],\\n        \\"properties\\": {\\n          \\"message\\": {\\n            \\"description\\": \\"A human readable error message\\",\\n            \\"type\\": \\"string\\"\\n          }\\n        }\\n      }\\n    },\\n    \\"securitySchemes\\": {\\n      \\"ApiKey\\": {\\n        \\"type\\": \\"apiKey\\",\\n        \\"in\\": \\"header\\",\\n        \\"name\\": \\"X-Api-Key\\"\\n      }\\n    }\\n  },\\n  \\"security\\": [\\n    {\\n      \\"ApiKey\\": []\\n    }\\n  ]\\n}",
  "options": {
    "disableOptionalParameters": true,
    "exampleParametersResolution": "Schema",
    "folderStrategy": "Paths"
  },
  "type": "string"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Import an OpenAPI Definition with Options (application/json)
using RestSharp;

var client = new RestClient("https://api.getpostman.com/import/openapi");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"input\": \"{\\n  \\\"openapi\\\": \\\"3.0.0\\\",\\n  \\\"servers\\\": [\\n    {\\n      \\\"url\\\": \\\"example.com\\\"\\n    }\\n  ],\\n  \\\"info\\\": {\\n    \\\"contact\\\": {\\n      \\\"name\\\": \\\"Jon\\\"\\n    },\\n    \\\"version\\\": \\\"1.0.0\\\",\\n    \\\"title\\\": \\\"Sample API\\\",\\n    \\\"description\\\": \\\"Buy or rent spacecrafts\\\"\\n  },\\n  \\\"paths\\\": {\\n    \\\"/spacecrafts/{spacecraftId}\\\": {\\n      \\\"parameters\\\": [\\n        {\\n          \\\"name\\\": \\\"spacecraftId\\\",\\n          \\\"description\\\": \\\"The unique identifier of the spacecraft\\\",\\n          \\\"in\\\": \\\"path\\\",\\n          \\\"required\\\": true,\\n          \\\"schema\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          }\\n        }\\n      ],\\n      \\\"get\\\": {\\n        \\\"summary\\\": \\\"Read a spacecraft\\\",\\n        \\\"responses\\\": {\\n          \\\"200\\\": {\\n            \\\"description\\\": \\\"The spacecraft corresponding to the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Spacecraft\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"404\\\": {\\n            \\\"description\\\": \\\"No spacecraft found for the provided `spacecraftId`\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          },\\n          \\\"500\\\": {\\n            \\\"description\\\": \\\"Unexpected error\\\",\\n            \\\"content\\\": {\\n              \\\"application/json\\\": {\\n                \\\"schema\\\": {\\n                  \\\"$ref\\\": \\\"#/components/schemas/Error\\\"\\n                }\\n              }\\n            }\\n          }\\n        }\\n      }\\n    }\\n  },\\n  \\\"components\\\": {\\n    \\\"schemas\\\": {\\n      \\\"SpacecraftId\\\": {\\n        \\\"description\\\": \\\"The unique identifier of a spacecraft\\\",\\n        \\\"type\\\": \\\"string\\\"\\n      },\\n      \\\"Spacecraft\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"id\\\",\\n          \\\"name\\\",\\n          \\\"type\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"id\\\": {\\n            \\\"$ref\\\": \\\"#/components/schemas/SpacecraftId\\\"\\n          },\\n          \\\"name\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          },\\n          \\\"type\\\": {\\n            \\\"type\\\": \\\"string\\\",\\n            \\\"enum\\\": [\\n              \\\"capsule\\\",\\n              \\\"probe\\\",\\n              \\\"satellite\\\",\\n              \\\"spaceplane\\\",\\n              \\\"station\\\"\\n            ]\\n          },\\n          \\\"description\\\": {\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      },\\n      \\\"Error\\\": {\\n        \\\"type\\\": \\\"object\\\",\\n        \\\"required\\\": [\\n          \\\"message\\\"\\n        ],\\n        \\\"properties\\\": {\\n          \\\"message\\\": {\\n            \\\"description\\\": \\\"A human readable error message\\\",\\n            \\\"type\\\": \\\"string\\\"\\n          }\\n        }\\n      }\\n    },\\n    \\\"securitySchemes\\\": {\\n      \\\"ApiKey\\\": {\\n        \\\"type\\\": \\\"apiKey\\\",\\n        \\\"in\\\": \\\"header\\\",\\n        \\\"name\\\": \\\"X-Api-Key\\\"\\n      }\\n    }\\n  },\\n  \\\"security\\\": [\\n    {\\n      \\\"ApiKey\\\": []\\n    }\\n  ]\\n}\",\n  \"options\": {\n    \"disableOptionalParameters\": true,\n    \"exampleParametersResolution\": \"Schema\",\n    \"folderStrategy\": \"Paths\"\n  },\n  \"type\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Import an OpenAPI Definition with Options (application/json)
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "input": "{
  \"openapi\": \"3.0.0\",
  \"servers\": [
    {
      \"url\": \"example.com\"
    }
  ],
  \"info\": {
    \"contact\": {
      \"name\": \"Jon\"
    },
    \"version\": \"1.0.0\",
    \"title\": \"Sample API\",
    \"description\": \"Buy or rent spacecrafts\"
  },
  \"paths\": {
    \"/spacecrafts/{spacecraftId}\": {
      \"parameters\": [
        {
          \"name\": \"spacecraftId\",
          \"description\": \"The unique identifier of the spacecraft\",
          \"in\": \"path\",
          \"required\": true,
          \"schema\": {
            \"$ref\": \"#/components/schemas/SpacecraftId\"
          }
        }
      ],
      \"get\": {
        \"summary\": \"Read a spacecraft\",
        \"responses\": {
          \"200\": {
            \"description\": \"The spacecraft corresponding to the provided `spacecraftId`\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Spacecraft\"
                }
              }
            }
          },
          \"404\": {
            \"description\": \"No spacecraft found for the provided `spacecraftId`\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Error\"
                }
              }
            }
          },
          \"500\": {
            \"description\": \"Unexpected error\",
            \"content\": {
              \"application/json\": {
                \"schema\": {
                  \"$ref\": \"#/components/schemas/Error\"
                }
              }
            }
          }
        }
      }
    }
  },
  \"components\": {
    \"schemas\": {
      \"SpacecraftId\": {
        \"description\": \"The unique identifier of a spacecraft\",
        \"type\": \"string\"
      },
      \"Spacecraft\": {
        \"type\": \"object\",
        \"required\": [
          \"id\",
          \"name\",
          \"type\"
        ],
        \"properties\": {
          \"id\": {
            \"$ref\": \"#/components/schemas/SpacecraftId\"
          },
          \"name\": {
            \"type\": \"string\"
          },
          \"type\": {
            \"type\": \"string\",
            \"enum\": [
              \"capsule\",
              \"probe\",
              \"satellite\",
              \"spaceplane\",
              \"station\"
            ]
          },
          \"description\": {
            \"type\": \"string\"
          }
        }
      },
      \"Error\": {
        \"type\": \"object\",
        \"required\": [
          \"message\"
        ],
        \"properties\": {
          \"message\": {
            \"description\": \"A human readable error message\",
            \"type\": \"string\"
          }
        }
      }
    },
    \"securitySchemes\": {
      \"ApiKey\": {
        \"type\": \"apiKey\",
        \"in\": \"header\",
        \"name\": \"X-Api-Key\"
      }
    }
  },
  \"security\": [
    {
      \"ApiKey\": []
    }
  ]
}",
  "options": [
    "disableOptionalParameters": true,
    "exampleParametersResolution": "Schema",
    "folderStrategy": "Paths"
  ],
  "type": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/import/openapi")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```