Update API Proxy
Overview
Updates an existing API proxy. The update can be done by reparsing from a new specification URL or file. The API proxy can be automatically deployed to specified environments after update.
Endpoint
Update from URL
PUT /apiops/projects/{projectName}/apiProxies/url/
Update from File
PUT /apiops/projects/{projectName}/apiProxies/file/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json (for URL) or multipart/form-data (for file) | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
Request Body
The request body structure is identical to Create API Proxy from URL or Create API Proxy from File, with the following differences:
Key Differences for Update
- reParse: Set
reParse: trueto update an existing API proxy - API Proxy Must Exist: The API proxy with the specified name must already exist
- Type Consistency: The
apiProxyCreationTypemust match the original type - Description: If
apiProxyDescriptionis empty, the existing description is preserved
Full JSON Body Example (Update from URL)
{
"apiProxyName": "petstore-api",
"apiProxyDescription": "Updated Petstore API Proxy",
"apiProxyCreationType": "OPEN_API",
"specUrl": "https://petstore.swagger.io/v2/swagger.json",
"clientRoute": {
"relativePathList": ["/api/v1"],
"hostList": ["api.example.com"]
},
"routingInfo": {
"routingAddressList": [
{
"address": "https://backend.example.com",
"weight": 100
}
],
"loadBalanceAlgorithm": "ROUND_ROBIN",
"connectTimeout": 30,
"readTimeout": 60
},
"deploy": true,
"deployTargetEnvironmentNameList": ["production"],
"reParse": true,
"soapToRest": false,
"enableWSA": false,
"enableWSRM": false,
"backendApiVersion": "v2",
"maintenanceModeSetting": {
"enabled": false,
"httpStatusCode": 503,
"contentType": "application/json",
"message": "Service is under maintenance"
}
}
Response
Success Response (200 OK)
{
"success": true,
"deploymentResult": {
"success": true,
"deploymentResults": [
{
"environmentName": "production",
"success": true,
"message": "Deployment successful"
}
]
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | Indicates if the request was successful |
| deploymentResult | object | Deployment result (if deploy=true) |
| deploymentResult.success | boolean | Overall deployment success |
| deploymentResult.deploymentResults | array | Individual environment deployment results |
Error Response (400 Bad Request)
{
"error": "bad_request",
"error_description": "ApiProxy (name: petstore-api) can not be reparsed because it is not exist. First create it!"
}
Common Causes
- API Proxy name does not exist (must create first)
- API Proxy creation type mismatch (cannot change type)
- Invalid specification URL or file
- SOAP to REST transformation not allowed (if original was SOAP without transformation)
- Missing required fields
Error Response (401 Unauthorized)
{
"error": "unauthorized_client",
"error_description": "Invalid token"
}
Error Response (404 Not Found)
{
"error": "not_found",
"error_description": "Project (MyProject) is not found or user does not have privilege to access it!"
}
cURL Example
Example 1: Update API Proxy from URL
curl -X PUT \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/url/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"apiProxyName": "petstore-api",
"apiProxyDescription": "Updated Petstore API",
"apiProxyCreationType": "OPEN_API",
"specUrl": "https://petstore.swagger.io/v2/swagger.json",
"clientRoute": {
"relativePathList": ["/api/v1"]
},
"reParse": true,
"deploy": false
}'
Example 2: Update API Proxy from File
curl -X PUT \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/file/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F 'metadata={
"apiProxyName": "petstore-api",
"apiProxyDescription": "Updated Petstore API",
"apiProxyCreationType": "OPEN_API",
"reParse": true,
"deploy": false
}' \
-F "specFile=@updated-openapi.json"
Example 3: Update and Deploy
curl -X PUT \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/url/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"apiProxyName": "petstore-api",
"apiProxyDescription": "Updated and deployed",
"apiProxyCreationType": "OPEN_API",
"specUrl": "https://petstore.swagger.io/v2/swagger.json",
"clientRoute": {
"relativePathList": ["/api/v1"]
},
"reParse": true,
"deploy": true,
"deployTargetEnvironmentNameList": ["production"]
}'
Notes and Warnings
- API Proxy Must Exist: The API proxy with the specified name must already exist. Use Create endpoints to create new API proxies.
- Type Consistency: The
apiProxyCreationTypemust match the original type. You cannot change from SOAP to REST or vice versa. - SOAP to REST: If the original API proxy was SOAP without protocol transformation, you cannot enable
soapToRestduring update. This must be set during initial creation. - Description Preservation: If
apiProxyDescriptionis empty or not provided, the existing description is preserved. - Client Route: If
clientRouteis not provided, the existing client route is preserved. - Deployment: If
deploy: true, ensure environments exist and user has deployment permissions. - Reparse: The
reParsefield must be set totruefor update operations (PUT endpoints).
Related Documentation
- Create API Proxy from URL - Create new API proxy from URL
- Create API Proxy from File - Create new API proxy from file
- Delete API Proxy - Delete API proxy
- List API Proxies - List all API proxies