Update Error Handling Settings
Endpoint
PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/error-handling/
Warning
This endpoint returns HTTP 400 for API proxies with type=AI. In earlier releases it returned 200 OK but had no effect (a silent no-op) — this is a behavior change and existing CI/CD pipelines that call this endpoint against AI proxies may be affected.
The AI proxy runtime does not read the classic routing object; the equivalent configuration lives under aiRouting. Use Update AI Routing instead.
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 | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
Request Body
Full JSON Body Example
{
"errorHandlingType": "STATUS_CODE_LIST",
"statusCodeList": [500, 502, 503, 504],
"customizeErrorMessageEnabled": true,
"errorMessageList": [
{
"httpStatusCode": 500,
"customizedHttpStatusCode": 503,
"customizedErrorCode": "BACKEND_ERROR",
"customizedMessage": "Service is temporarily unavailable"
},
{
"httpStatusCode": 502,
"customizedHttpStatusCode": 502,
"customizedErrorCode": "BAD_GATEWAY",
"customizedMessage": "Bad gateway response from backend"
}
],
"deploy": false,
"deployTargetEnvironmentNameList": []
}
Request Body Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| errorHandlingType | string | No | DEFAULT | Error handling strategy. See EnumErrorHandlingType |
| statusCodeList | array[integer] | No | - | List of HTTP status codes that trigger custom error handling |
| customizeErrorMessageEnabled | boolean | No | false | Enable custom error messages for matching status codes |
| errorMessageList | array[object] | No | - | List of custom error message definitions. See Error Message Object |
| deploy | boolean | No | false | If true, deploy the API proxy after saving changes |
| deployTargetEnvironmentNameList | array[string] | No | - | List of environment names to deploy to (required when deploy=true) |
EnumErrorHandlingType
DEFAULT- Use default error handling (pass through backend errors)ADVANCED- Advanced error handling with full customizationSTATUS_CODE_LIST- Custom handling for specific HTTP status codes only
Error Message Object
| Field | Type | Required | Description |
|---|---|---|---|
| httpStatusCode | integer | Yes | Original HTTP status code to match |
| customizedHttpStatusCode | integer | No | Replacement HTTP status code to return to client |
| customizedErrorCode | string | No | Custom error code string |
| customizedMessage | string | No | Custom error message text |
Note: All fields are optional. Only provided fields are updated.
Response
Success Response (200 OK)
{
"success": true
}
When deploy=true is specified:
{
"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 | Only present when deploy=true |
| deploymentResult.success | boolean | Overall deployment success status |
| deploymentResult.deploymentResults | array | Per-environment deployment results |