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:
- Is the
/v1/projects/{id}/import-openapi
endpoint still active? - What’s the correct payload structure for 2024-03-28 API version?
- 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