# Import Postman Collection Data

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/projects/{projectId}/import-postman-collection:
    post:
      summary: Import Postman Collection Data
      deprecated: false
      description: Apidog supports importing data in the Postman Collection v2 format.
      tags:
        - Import & Export
      parameters:
        - name: projectId
          in: path
          description: ''
          required: true
          example: '{{projectId}}'
          schema:
            type: string
        - name: locale
          in: query
          description: ''
          required: false
          example: en-US
          schema:
            type: string
        - name: X-Apidog-Api-Version
          in: header
          description: OpenAPI versions, required, otherwise an error will occur.
          required: true
          example: '2024-03-28'
          schema:
            type: string
            enum:
              - '2024-03-28'
            x-apidog:
              enumDescriptions:
                '2024-03-28': ''
        - name: Authorization
          in: header
          description: >-
            Authorization is in the format of Bearer Personal Access Token.
            Refer to How to Generate Apidog OpenAPI Access Token for more
            information.
          required: true
          example: Bearer {{access_token}}
          schema:
            type: string
            default: Bearer {{access_token}}
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                input:
                  type: string
                  description: >-
                    The stringified JSON format of a Postman Collection.


                    You can export this from Postman. See how to export
                    collections
                    [here](https://learning.postman.com/docs/getting-started/importing-and-exporting/exporting-data/#export-collections).
                options:
                  type: object
                  properties:
                    targetEndpointFolderId:
                      type: number
                      description: >-
                        The ID of the target folder for matching APIs. If not
                        specified, the target folder will be the `Root` folder.
                    endpointOverwriteBehavior:
                      type: string
                      description: >-
                        When importing APIs, specify how to handle APIs that
                        matches the existing ones based on the combination of
                        **HTTP method** and **Path**. It determines whether to
                        override, automatically merge changes, skip changes and
                        retain the existing API, or create a new one.
                      enum:
                        - OVERWRITE_EXISTING
                        - AUTO_MERGE
                        - KEEP_EXISTING
                        - CREATE_NEW
                      default: OVERWRITE_EXISTING
                      x-apidog-enum:
                        - value: OVERWRITE_EXISTING
                          name: ''
                          description: Overwrite existing endpoint
                        - value: AUTO_MERGE
                          name: ''
                          description: >-
                            Automatically merge changes into the existing
                            endpoint.
                        - value: KEEP_EXISTING
                          name: ''
                          description: Skip changes and retain the existing endpoint.
                        - value: CREATE_NEW
                          name: ''
                          description: Keep existing endpoints and create new one.
                    endpointCaseOverwriteBehavior:
                      type: string
                      description: >-
                        Specify how to handle matching Request Definitions
                        within an API. It determines whether to override the
                        existing Request Definition, skip changes and retain the
                        existing one, or create a new Request Definition.


                        Request Definitions are only matched with **Endpoint
                        case** when using the same name as an existing one
                        within the same **API**.
                      enum:
                        - OVERWRITE_EXISTING
                        - KEEP_EXISTING
                        - CREATE_NEW
                      default: OVERWRITE_EXISTING
                      x-apidog-enum:
                        - value: OVERWRITE_EXISTING
                          name: ''
                          description: Overwrite existing endpoint
                        - value: KEEP_EXISTING
                          name: ''
                          description: Skip changes and retain the existing endpoint.
                        - value: CREATE_NEW
                          name: ''
                          description: Keep existing endpoints and create new one.
                    updateFolderOfChangedEndpoint:
                      type: boolean
                      description: >-
                        During the import process of an existing API Endpoint,
                        indicate whether to update the catalog ID of the API. If
                        you want to change the catalog ID along with the
                        imported API Endpoint, set this option to true.
                      default: false
                    targetBranchId:
                      type: number
                      description: >-
                        The ID of the branch for the data import. Defaults to
                        the `main` branch ID if unspecified.
                    moduleId:
                      type: number
                      description: >+
                        The ID of the module for the data import. Defaults to
                        the default module ID if unspecified.

                  x-apidog-orders:
                    - targetEndpointFolderId
                    - endpointOverwriteBehavior
                    - endpointCaseOverwriteBehavior
                    - updateFolderOfChangedEndpoint
                    - targetBranchId
                    - moduleId
                  description: >-
                    Objects containing advanced options and their values for the
                    importing process.
              x-apidog-orders:
                - input
                - options
              required:
                - input
            example:
              input: >-
                {"info":{"name":"Swagger Petstore","description":"This is a
                sample server Petstore
                server.","schema":"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},"item":[],"variable":[{"key":"baseUrl","value":"//petstore.swagger.io/v2","type":"string"}]}
              options:
                targetEndpointFolderId: 0
                endpointOverwriteBehavior: OVERWRITE_EXISTING
                endpointCaseOverwriteBehavior: OVERWRITE_EXISTING
                updateFolderOfChangedEndpoint: false
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      counters:
                        type: object
                        properties:
                          endpointCreated:
                            type: integer
                            title: The number of endpoints created
                          endpointUpdated:
                            type: integer
                            title: The number of endpoints updated
                          endpointFailed:
                            type: integer
                            title: The number of endpoints import failed
                          endpointIgnored:
                            type: integer
                            title: The number of endpoints ignored
                          endpointFolderCreated:
                            type: integer
                            title: The number of endpoint folders created
                          endpointFolderUpdated:
                            type: integer
                            title: The number of endpoint folders updated
                          endpointFolderFailed:
                            type: integer
                            title: The number of endpoint folders import failed
                          endpointFolderIgnored:
                            type: integer
                            title: The number of endpoint folders ignored
                          endpointCaseCreated:
                            type: integer
                            title: The number of endpoint cases created
                          endpointCaseUpdated:
                            type: integer
                            title: The number of endpoint cases updated
                          endpointCaseFailed:
                            type: integer
                            title: The number of endpoint cases import failed
                          endpointCaseIgnored:
                            type: integer
                            title: The number of endpoint cases ignored
                        title: Statistics of imported APIs
                        required:
                          - endpointCreated
                          - endpointUpdated
                          - endpointFailed
                          - endpointIgnored
                          - endpointCaseCreated
                          - endpointCaseIgnored
                          - endpointCaseFailed
                          - endpointCaseUpdated
                          - endpointFolderIgnored
                          - endpointFolderFailed
                          - endpointFolderUpdated
                          - endpointFolderCreated
                        x-apidog-orders:
                          - endpointCreated
                          - endpointUpdated
                          - endpointFailed
                          - endpointIgnored
                          - endpointFolderCreated
                          - endpointFolderUpdated
                          - endpointFolderFailed
                          - endpointFolderIgnored
                          - endpointCaseCreated
                          - endpointCaseUpdated
                          - endpointCaseFailed
                          - endpointCaseIgnored
                      errors:
                        type: array
                        items:
                          type: object
                          properties:
                            message:
                              type: string
                            code:
                              type: string
                          x-apidog-orders:
                            - message
                            - code
                          required:
                            - message
                            - code
                    title: Imported results
                    required:
                      - counters
                    x-apidog-orders:
                      - counters
                      - errors
                required:
                  - data
                x-apidog-orders:
                  - data
              example:
                data:
                  counters:
                    endpointCreated: 10
                    endpointUpdated: 0
                    endpointFailed: 0
                    endpointIgnored: 0
                    endpointFolderCreated: 0
                    endpointFolderUpdated: 0
                    endpointFolderFailed: 0
                    endpointFolderIgnored: 0
                    endpointCaseCreated: 0
                    endpointCaseUpdated: 0
                    endpointCaseFailed: 0
                    endpointCaseIgnored: 0
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: Import & Export
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/538323/apis/api-7312736-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.apidog.com
    description: Prod Env
security: []

```
