Apidog API
  1. Import & Export
Apidog API
  • Introduction
  • API Versions
  • Authentication
  • Import & Export
    • Import OpenAPI/Swagger Data
      POST
    • Import Postman Collection Data
      POST
    • Export Data in OpenAPI/Swagger Format
      POST
  1. Import & Export

Import Postman Collection Data

POST
/v1/projects/{projectId}/import-postman-collection
Apidog supports importing data in the Postman Collection v2 format.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://api.apidog.com/v1/projects/{{projectId}}/import-postman-collection?locale=en-US' \
--header 'X-Apidog-Api-Version;' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
   "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
   }
}'
Response Response 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
    }
  }
}

Request

Path Params
projectId
string 
required
Example:
{{projectId}}
Query Params
locale
string 
optional
Example:
en-US
Header Params
X-Apidog-Api-Version
enum<string> 
required
OpenAPI versions, required, otherwise an error will occur.
Allowed value:
2024-03-28
Default:
2024-03-28
Authorization
string 
required
Authorization is in the format of Bearer Personal Access Token. Refer to How to Generate Apidog OpenAPI Access Token for more information.
Default:
Bearer {{access_token}}
Body Params application/json
input
string 
required
The stringified JSON format of a Postman Collection.
You can export this from Postman. See how to export collections here.
options
object 
optional
Objects containing advanced options and their values for the importing process.
targetEndpointFolderId
number 
optional
The ID of the target folder for matching APIs. If not specified, the target folder will be the Root folder.
endpointOverwriteBehavior
enum<string> 
optional
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.
Allowed values:
OVERWRITE_EXISTINGAUTO_MERGEKEEP_EXISTINGCREATE_NEW
Default:
OVERWRITE_EXISTING
endpointCaseOverwriteBehavior
enum<string> 
optional
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.
Allowed values:
OVERWRITE_EXISTINGKEEP_EXISTINGCREATE_NEW
Default:
OVERWRITE_EXISTING
updateFolderOfChangedEndpoint
boolean 
optional
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
Examples

Responses

🟢200Success
application/json
Body
data
object 
Imported results
required
counters
object 
Statistics of imported APIs
required
errors
array [object {2}] 
optional
Modified at 2024-12-04 04:32:07
Previous
Import OpenAPI/Swagger Data
Next
Export Data in OpenAPI/Swagger Format
Built with