Update Connection Settings
Endpoint
PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/connection/
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
{
"connectTimeout": 30,
"readTimeout": 60,
"connectionRequestTimeout": 30,
"validateAfterInactivity": 2000,
"idleConnectionTimeout": 30,
"redirectsEnabled": true,
"maxRedirects": 50,
"relativeRedirectsAllowed": true,
"disableContentCompression": false,
"enableStreaming": false,
"ignoreRoutingError": false,
"queryEncodingMode": "STANDARD",
"connectionPoolManagementType": "GENERAL",
"customConnectionPoolSize": 8,
"hopByHopHeaders": ["X-Custom-Internal"],
"sendUserAgentToBackend": true,
"userAgentValue": "Apinizer-Gateway/1.0",
"doNotRouteZeroValueContentLength": false,
"enableDownload": false,
"useByteArrayForCompressedResponse": false
}
Request Body Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| connectionSettingsEnabled | boolean | No | - | Enable/disable custom connection settings |
| connectTimeout | integer | No | - | Connection timeout in seconds |
| readTimeout | integer | No | - | Read timeout in seconds |
| connectionRequestTimeout | integer | No | - | Connection request timeout in seconds |
| validateAfterInactivity | integer | No | 2000 | Validate connections after inactivity (milliseconds). Tune per backend load balancer keep-alive timeout. |
| idleConnectionTimeout | integer | No | 30 | Evict idle connections after this period (seconds). Tune per backend load balancer keep-alive timeout. |
| redirectsEnabled | boolean | No | - | Enable/disable HTTP redirects |
| maxRedirects | integer | No | - | Maximum number of redirects |
| relativeRedirectsAllowed | boolean | No | - | Allow relative redirects |
| disableContentCompression | boolean | No | - | Disable content compression |
| enableStreaming | boolean | No | - | Enable streaming mode |
| ignoreRoutingError | boolean | No | false | Ignore the API proxy's error response template when the backend returns an error. See Ignore Error Response Template below |
| queryEncodingMode | string | No | STANDARD | How query parameter values are encoded before routing to the backend. See EnumQueryEncodingMode below |
| connectionPoolManagementType | string | No | - | Connection pool management type. See EnumConnectionPoolManagementType |
| customConnectionPoolSize | integer | No* | - | Custom connection pool size (required if connectionPoolManagementType=CUSTOM) |
| hopByHopHeaders | array[string] | No | - | List of hop-by-hop headers to remove before forwarding to backend |
| sendUserAgentToBackend | boolean | No | - | Send User-Agent header to backend |
| userAgentValue | string | No | - | Custom User-Agent header value (used when sendUserAgentToBackend=true) |
| doNotRouteZeroValueContentLength | boolean | No | - | Do not route requests with Content-Length: 0 |
| enableDownload | boolean | No | - | Enable file download support for large response bodies |
| useByteArrayForCompressedResponse | boolean | No | - | Use byte array for compressed response handling |
EnumConnectionPoolManagementType
GENERAL- General connection pool (shared pool)CUSTOM- Custom connection pool (requires customConnectionPoolSize)NONE- No connection pool
EnumQueryEncodingMode
Controls how query parameter values are encoded when the gateway builds the backend request URL. Corresponds to the Query Parameter Encoding setting on the API Proxy routing screen.
STANDARD(default) — form-style URL encoding; characters such as/,+, and=are escaped (for example/→%2F). Existing proxies keep this behavior when the field is omitted or null.RFC3986— preserves characters allowed in the RFC 3986 query component (/,+,=,:,@); only characters that must be escaped (space,#,&,%, non-ASCII, etc.) are encoded. Suitable when backends expect raw base64/JWT-like values.PASSTHROUGH— passes values through with only minimal safety escaping (space, line breaks). PreferRFC3986unless you fully control the query values.
See also the Manager documentation: HTTP Routing — Query Parameter Encoding.
Ignore Error Response Template (ignoreRoutingError)
ignoreRoutingError controls what the client receives when the backend returns an error status for a routed request. It corresponds to the "Ignore Error Response Template In Case Of Error On Backend API" option in the API Proxy routing UI.
false(default) — when the backend responds with an error, the API proxy's configured error response template (see Update JSON Error Template / Update XML Error Template) is applied and returned to the client instead of the raw backend response.true— the error response template is skipped for backend errors; the backend's original status code and body are passed through to the client unchanged.
This setting is also available at API proxy create/update time via routingInfo.ignoreRoutingError on Create API Proxy from URL / Update API Proxy from URL (and their file-based equivalents).
API Proxy Groups have an equivalent "Ignore Routing Error" setting in the Manager UI, but it is not exposed through the API Proxy Group APIops endpoints — it can only be configured from the UI.
Note: All fields are optional. Only provided fields are updated.
Response
Success Response (200 OK)
{
"success": true
}
Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | Indicates if the request was successful |
Error Response (400 Bad Request)
{
"status": "FAILURE",
"resultMessage": "Custom connection pool size is required when connectionPoolManagementType is CUSTOM"
}
Error Response (401 Unauthorized)
{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}
cURL Example
Example 1: Configure Connection Timeouts
curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/connection/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"connectionSettingsEnabled": true,
"connectTimeout": 30,
"readTimeout": 60,
"connectionRequestTimeout": 30
}'
Example 2: Configure Custom Connection Pool
curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/connection/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"connectionSettingsEnabled": true,
"connectionPoolManagementType": "CUSTOM",
"customConnectionPoolSize": 20,
"connectTimeout": 60,
"readTimeout": 120
}'
Example 3: Configure Connection Pool Stale/Idle Handling
curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/connection/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"connectionSettingsEnabled": true,
"validateAfterInactivity": 2000,
"idleConnectionTimeout": 30
}'
Example 4: Configure Header and Response Settings
curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/connection/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"hopByHopHeaders": ["X-Internal-Trace", "X-Debug-Info"],
"sendUserAgentToBackend": true,
"userAgentValue": "Apinizer-Gateway/1.0",
"enableDownload": true
}'
Notes and Warnings
- Timeouts: Connection and read timeouts are in seconds; validateAfterInactivity is in milliseconds
- Connection Pool: validateAfterInactivity and idleConnectionTimeout help prevent stale connection issues; tune per backend load balancer keep-alive timeout
- Connection Pool:
CUSTOMrequirescustomConnectionPoolSizeto be set - Redirects: When
redirectsEnabled=true, HTTP redirects are followed (maxmaxRedirects) - Streaming: When
enableStreaming=true, response is streamed instead of buffered - Content Compression: When
disableContentCompression=true, content compression is disabled - Hop-by-Hop Headers: Headers listed in
hopByHopHeadersare removed before the request is forwarded to the backend - User-Agent: When
sendUserAgentToBackend=true, the specifieduserAgentValueis sent as the User-Agent header to the backend - Download Mode: When
enableDownload=true, the gateway handles large response bodies as file downloads - Error Response Template: When
ignoreRoutingError=true, backend error responses are passed through to the client as-is instead of being wrapped in the API proxy's error response template — see Ignore Error Response Template above
Permissions
User must have API_MANAGEMENT + MANAGE permission in the project.
Related Documentation
- Update Circuit Breaker Settings - Update circuit breaker settings
- Update Routing Addresses - Update routing addresses
- Update JSON Error Template - Configure the JSON error response template
- Update XML Error Template - Configure the XML error response template
- Get API Proxy - Get API proxy details
- Get Deploy Status - Check deploy status after applying connection settings
- Get Worker Route Health - Verify the route is live on worker pods