Import API Proxy (Without Override)
Overview
Imports an API Proxy from a ZIP file. If an API Proxy with the same name already exists, the imported API Proxy will have a suffix added to its name and relative path to prevent conflicts. This method does not override existing API Proxies.
Endpoint
POST /apiops/projects/{projectName}/apiProxies/import/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | multipart/form-data | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name where the API Proxy will be imported |
Form Data
| Parameter | Type | Required | Description |
|---|---|---|---|
| apiProxyExportFile | file | Yes | ZIP file containing the API Proxy export. Must have .zip extension |
Notes
- File must be a valid ZIP archive
- File must end with
.zipextension (case-insensitive) - ZIP file must contain a valid API Proxy export JSON file
- If an API Proxy with the same name exists, a suffix will be added automatically
Response
Success Response (200 OK)
{
"status": "SUCCESS"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| status | string | Response status: SUCCESS or FAILURE |
Error Response (400 Bad Request)
{
"error": "bad_request",
"error_description": "projectName value can not be empty!"
}
or
{
"error": "bad_request",
"error_description": "apiProxyExportFile value can not be empty!"
}
or
{
"error": "bad_request",
"error_description": "apiProxyExportFile parameter must be in zip file format and must end with zip extension!"
}
Common Causes
- Empty
projectName - Empty or missing file
- File is not a ZIP archive
- File does not have
.zipextension - Invalid API Proxy export format
Error Response (401 Unauthorized)
{
"error": "unauthorized_client",
"error_description": "Invalid token"
}
Error Response (404 Not Found)
{
"error": "not_found",
"error_description": "Project(MyProject) was not found or user does not have privilege to access it!"
}
cURL Example
Example 1: Import API Proxy
curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/import/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "apiProxyExportFile=@apiProxyExportFile.zip"
Example 2: Import API Proxy with Custom Filename
curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/import/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "apiProxyExportFile=@my-api-export.zip"
Notes and Warnings
- No Override:
- This endpoint does not override existing API Proxies
- If an API Proxy with the same name exists, a suffix will be added automatically
- Original API Proxy remains unchanged
- Automatic Naming:
- Imported API Proxy name may be modified if a conflict exists
- Relative paths may also be modified to prevent conflicts
- Check the imported API Proxy name after import
- File Format:
- File must be a valid ZIP archive
- File must end with
.zipextension (case-insensitive) - ZIP file must contain valid API Proxy export JSON
- Project Validation:
- Project must exist
- User must have access to the project
- User must have
ROLE_MANAGE_PROXIESpermission
- Import Content:
- Import includes all API Proxy configurations
- Includes all associated policies
- Includes routing, cache, CORS, and other settings
- Deployment Status:
- Imported API Proxy is not deployed by default
- Deployment status from export is preserved
- You may need to deploy the imported API Proxy manually
- Permissions:
- Requires
ROLE_MANAGE_PROXIESpermission - User must have access to the target project
- Requires
- File Size:
- Large export files may take longer to import
- Ensure sufficient network bandwidth and server resources
- Validation:
- Import validates API Proxy structure
- Invalid configurations may cause import to fail
- Check error messages for validation issues
Related Documentation
- Export API Proxy - Export API Proxy to ZIP file
- Import API Proxy (With Override) - Import API Proxy with override option
- List API Proxies - List all API Proxies in project