API Import Issue: Error 422001 "Invalid Parameter" on /v1/projects/{id}/import-openapi

Environment:

  • API URL: https://api.apidog.com
  • API Version: 2024-03-28
  • Project ID: 1027646
  • User Role: Administrator

Problem:
I’m trying to programmatically import OpenAPI/Swagger spec via API but getting consistent 422001 "Invalid Parameter" errors. The same integration worked perfectly in my previous company.

What Fails:
POST /v1/projects/{id}/import-openapi - Always returns 422001

Request Details:

Headers:
{
“Authorization”: “Bearer APS-[key]”,
“X-Apidog-Api-Version”: “2024-03-28”,
“Content-Type”: “application/json”,
“Accept”: “application/json”
}

Payload:
{
“options”: {
“targetSchemaFolderId”: 0,
“endpointOverwriteBehavior”: “OVERWRITE_EXISTING”,
“schemaOverwriteBehavior”: “OVERWRITE_EXISTING”,
“updateFolderOfChangedEndpoint”: true,
“prependBasePath”: false
},
“swagger”: {
“openapi”: “3.0.0”,
“info”: { … },
“paths”: { … }
}
}


**Error Response:**
```json
{
  "success": false,
  "errorCode": "422001", 
  "errorMessage": "Invalid Parameter"
}

Tested Variations:

  • Different header combinations
  • Multiple payload structures (with/without input field)
  • Minimal swagger spec
  • Different API versions (2023-06-01, 2024-03-28)
  • With/without targetEndpointFolderId

Questions:

  1. Is the /v1/projects/{id}/import-openapi endpoint still active?
  2. What’s the correct payload structure for 2024-03-28 API version?
  3. Has the endpoint changed recently?
    The exact same code worked in my previous company. I have full admin access to the project (can read all endpoints, members, folders). Only the import endpoint fails with 422001.

Could you please provide:

  • Current API documentation for the import endpoint
  • Example of working payload structure
  • Any recent changes to this endpoin

The 422001 “Invalid Parameter” error can sometimes occur due to abnormal data in the “paths” section. Try simplifying your Swagger data to just {"swagger":{"openapi":"3.0.0"}} and test again. This will help determine if the issue is with the Swagger data or another cause.

You can also try your data and token on our online documentation to determine if it’s a code issue.