Update Proxy Server Settings
Endpoint
PATCH /apiops/projects/{projectName}/apiProxies/{apiProxyName}/settings/proxy-server/
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
{
"proxyEnabled": true,
"proxyFromHeaderEnabled": false,
"proxyHost": "proxy.example.com",
"proxyPort": 8080,
"proxyAuthorizationNeeded": true,
"proxyUsername": "proxy-user",
"proxyPassword": "proxy-pass",
"deploy": false,
"deployTargetEnvironmentNameList": []
}
Request Body Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| proxyEnabled | boolean | No | - | Enable/disable proxy server |
| proxyFromHeaderEnabled | boolean | No | - | Get proxy settings from request headers |
| proxyHost | string | No* | - | Proxy server hostname (required if proxyEnabled=true and proxyFromHeaderEnabled=false) |
| proxyPort | integer | No* | - | Proxy server port (required if proxyEnabled=true and proxyFromHeaderEnabled=false) |
| proxyAuthorizationNeeded | boolean | No | - | Require proxy authentication |
| proxyUsername | string | No* | - | Proxy username (required if proxyAuthorizationNeeded=true) |
| proxyPassword | string | No* | - | Proxy password (required if proxyAuthorizationNeeded=true) |
| 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) |
Note: All fields are optional. Only provided fields are updated.
Proxy from Header
When proxyFromHeaderEnabled=true, proxy settings are read from request headers:
X-Proxy-Host- Proxy hostnameX-Proxy-Port- Proxy portX-Proxy-Authorization- Proxy authorization (Basic auth token)
Response
Success Response (200 OK)
{
"success": true
}
Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | Indicates if the request was successful |
When deploy=true is specified:
{
"success": true,
"deploymentResult": {
"success": true,
"deploymentResults": [
{
"environmentName": "production",
"success": true,
"message": "Deployment successful"
}
]
}
}
| Field | Type | Description |
|---|---|---|
| deploymentResult | object | Only present when deploy=true |
| deploymentResult.success | boolean | Overall deployment success status |
| deploymentResult.deploymentResults | array | Per-environment deployment results |
Error Response (400 Bad Request)
{
"error": "bad_request",
"error_description": "Proxy host and port are required when proxy is enabled"
}
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 Proxy Server
curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/proxy-server/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"proxyEnabled": true,
"proxyFromHeaderEnabled": false,
"proxyHost": "proxy.example.com",
"proxyPort": 8080,
"proxyAuthorizationNeeded": true,
"proxyUsername": "proxy-user",
"proxyPassword": "proxy-pass"
}'
Example 2: Configure Proxy from Headers
curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/proxy-server/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"proxyEnabled": true,
"proxyFromHeaderEnabled": true,
"proxyAuthorizationNeeded": true
}'
Example 3: Save and Deploy
curl -X PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/settings/proxy-server/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"proxyEnabled": true,
"proxyHost": "proxy.example.com",
"proxyPort": 8080,
"deploy": true,
"deployTargetEnvironmentNameList": ["production"]
}'
Notes and Warnings
- Proxy Host/Port: Required when
proxyEnabled=trueandproxyFromHeaderEnabled=false - Proxy from Header: When enabled, proxy settings are read from request headers per request
- Authorization: When
proxyAuthorizationNeeded=true, provideproxyUsernameandproxyPassword(or use header) - Password Security: Proxy password is encrypted when stored
- Deploy: When
deploy=true, the API proxy is automatically deployed to the specified environments after saving
Permissions
User must have API_MANAGEMENT + MANAGE permission in the project.
Related Documentation
- Update Connection Settings - Update connection settings
- Get API Proxy - Get API proxy details