Update Connection Settings

Overview

Updates connection settings for an API proxy. Connection settings control timeout, retry, redirect, and connection pool behavior.

Endpoint

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

Authentication

Requires a Personal API Access Token.

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

{
  "connectionSettingsEnabled": true,
  "connectTimeout": 30,
  "readTimeout": 60,
  "connectionRequestTimeout": 30,
  "redirectsEnabled": true,
  "maxRedirects": 50,
  "relativeRedirectsAllowed": true,
  "disableContentCompression": false,
  "enableStreaming": false,
  "retryCount": 3,
  "failoverRetryCount": 2,
  "ignoreRoutingError": false,
  "connectionPoolManagementType": "GENERAL",
  "customConnectionPoolSize": 8
}

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
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
retryCount integer No - Number of retries on failure
failoverRetryCount integer No - Number of failover retries
ignoreRoutingError boolean No - Ignore routing errors
connectionPoolManagementType string No - Connection pool management type
customConnectionPoolSize integer No* - Custom connection pool size (required if connectionPoolManagementType=CUSTOM)

EnumConnectionPoolManagementType

  • GENERAL - General connection pool (shared pool)
  • CUSTOM - Custom connection pool (requires customConnectionPoolSize)
  • NONE - No connection pool

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)

{
  "error": "bad_request",
  "error_description": "Custom connection pool size is required when connectionPoolManagementType is CUSTOM"
}

Error Response (401 Unauthorized)

{
  "error": "unauthorized_client",
  "error_description": "Invalid token"
}

Error Response (404 Not Found)

{
  "error": "not_found",
  "error_description": "ApiProxy (name: MyAPI) was not found!"
}

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,
    "retryCount": 3,
    "failoverRetryCount": 2
  }'

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
  }'

Notes and Warnings

  • Timeouts: All timeout values are in seconds
  • Connection Pool: CUSTOM requires customConnectionPoolSize to be set
  • Retries: retryCount retries on same backend, failoverRetryCount tries failover backends
  • 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
  • Permissions: Requires ROLE_MANAGE_PROXIES permission