Ana içeriğe geç

Update Connection Settings

Endpoint

PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/connection/
uyarı

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.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI 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

FieldTypeRequiredDefaultDescription
connectionSettingsEnabledbooleanNo-Enable/disable custom connection settings
connectTimeoutintegerNo-Connection timeout in seconds
readTimeoutintegerNo-Read timeout in seconds
connectionRequestTimeoutintegerNo-Connection request timeout in seconds
validateAfterInactivityintegerNo2000Validate connections after inactivity (milliseconds). Tune per backend load balancer keep-alive timeout.
idleConnectionTimeoutintegerNo30Evict idle connections after this period (seconds). Tune per backend load balancer keep-alive timeout.
redirectsEnabledbooleanNo-Enable/disable HTTP redirects
maxRedirectsintegerNo-Maximum number of redirects
relativeRedirectsAllowedbooleanNo-Allow relative redirects
disableContentCompressionbooleanNo-Disable content compression
enableStreamingbooleanNo-Enable streaming mode
ignoreRoutingErrorbooleanNofalseIgnore the API proxy's error response template when the backend returns an error. See Ignore Error Response Template below
queryEncodingModestringNoSTANDARDHow query parameter values are encoded before routing to the backend. See EnumQueryEncodingMode below
connectionPoolManagementTypestringNo-Connection pool management type. See EnumConnectionPoolManagementType
customConnectionPoolSizeintegerNo*-Custom connection pool size (required if connectionPoolManagementType=CUSTOM)
hopByHopHeadersarray[string]No-List of hop-by-hop headers to remove before forwarding to backend
sendUserAgentToBackendbooleanNo-Send User-Agent header to backend
userAgentValuestringNo-Custom User-Agent header value (used when sendUserAgentToBackend=true)
doNotRouteZeroValueContentLengthbooleanNo-Do not route requests with Content-Length: 0
enableDownloadbooleanNo-Enable file download support for large response bodies
useByteArrayForCompressedResponsebooleanNo-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). Prefer RFC3986 unless 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).

not

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

FieldTypeDescription
successbooleanIndicates 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: CUSTOM requires customConnectionPoolSize to be set
  • Redirects: When redirectsEnabled=true, HTTP redirects are followed (max maxRedirects)
  • 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 hopByHopHeaders are removed before the request is forwarded to the backend
  • User-Agent: When sendUserAgentToBackend=true, the specified userAgentValue is 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.