Update Traffic Log Settings
Endpoint
PUT /apiops/projects/{projectName}/apiProxies/{apiProxyName}/trafficLogSettings/{environmentName}/
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 |
| environmentName | string | Yes | Environment name |
Request Body
{
"logParamRequestFromClient": true,
"logHeaderRequestFromClient": true,
"logBodyRequestFromClient": true,
"logParamRequestToTarget": true,
"logHeaderRequestToTarget": true,
"logBodyRequestToTarget": true,
"logHeaderResponseFromTarget": true,
"logBodyResponseFromTarget": true,
"logHeaderResponseToClient": true,
"logBodyResponseToClient": true,
"connectorSettingsMap": {
"Production Elasticsearch": {
"enabled": true,
"logBodyRequestFromClient": true,
"logBodyResponseFromTarget": true,
"enableBodyFromClientSize": true,
"sizeBodyFromClient": 1024
}
},
"methodOverrideList": [
{
"apiMethodId": "method-uuid-123",
"apiMethodName": "/pets",
"connectorSettingsMap": {
"Production Elasticsearch": {
"logBodyRequestFromClient": false
}
}
}
]
}
Request Body Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| logParamRequestFromClient | boolean | No | true | Log query parameters from client request |
| logHeaderRequestFromClient | boolean | No | true | Log headers from client request |
| logBodyRequestFromClient | boolean | No | true | Log body from client request |
| logParamRequestToTarget | boolean | No | true | Log query parameters sent to target |
| logHeaderRequestToTarget | boolean | No | true | Log headers sent to target |
| logBodyRequestToTarget | boolean | No | true | Log body sent to target |
| logHeaderResponseFromTarget | boolean | No | true | Log headers from target response |
| logBodyResponseFromTarget | boolean | No | true | Log body from target response |
| logHeaderResponseToClient | boolean | No | true | Log headers sent to client response |
| logBodyResponseToClient | boolean | No | true | Log body sent to client response |
| connectorSettingsMap | object | No | Per-connector detailed settings. Key is the connection name as defined in the project. Use the List Connections endpoint to discover available connection names. Legacy connector type keys (e.g., ELASTICSEARCH_INDEX) are also accepted for backward compatibility. | |
| methodOverrideList | array | No | [] | Method-level override list. Only methods that differ from proxy-level settings need entries here. |
The enableDatabaseConnector, enableElasticsearchConnector, enableSyslogConnector, enableWebhookConnector, enableRabbitMqConnector, enableActiveMqConnector, enableKafkaConnector, enableGraylogConnector, and enableLogbackConnector fields exist on the entity but are not mapped by this PUT endpoint. Use connectorSettingsMap with the appropriate connection name instead.
Top-level log flags default to true when settings are first created. On update, omit a field or send null to keep the existing value; only non-null fields in the request body are applied.
methodOverrideList[]
| Field | Type | Required | Description |
|---|---|---|---|
| apiMethodId | string | Yes | API method ID. Used at runtime to match the override to the method. |
| apiMethodName | string | No | API method endpoint path (e.g., /pets, /users/{id}). Stored for display; matching uses apiMethodId. |
| connectorSettingsMap | object | No | Per-connector settings override for this method. Same key format as proxy-level connectorSettingsMap. |
Note: All fields are optional. Only provided fields are updated. If settings do not exist for the environment, they are created automatically.
Response
Success Response (200 OK)
{
"status": "SUCCESS",
"resultList": [
{
"logParamRequestFromClient": true,
"logBodyRequestFromClient": true,
"connectorSettingsMap": {
"Production Elasticsearch": {
"enabled": true
}
}
}
],
"resultCount": 1
}
PUT response keys: The PUT response's connectorSettingsMap keys are connector UUIDs (or legacy EnumExecutableType names), not resolved to connection names. GET responses resolve UUID keys to connection names.
cURL Example
curl -X PUT \
"https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/MyAPI/trafficLogSettings/production/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"logBodyRequestFromClient": true,
"logBodyResponseFromTarget": true,
"connectorSettingsMap": {
"Production Elasticsearch": {
"enabled": true,
"logBodyRequestFromClient": true,
"enableBodyFromClientSize": true,
"sizeBodyFromClient": 2048
}
}
}'
Notes and Warnings
- Automatic Deployment: Changes are automatically deployed to the corresponding environment after save
- Environment-Specific: Settings are scoped to a single environment
- Connector Settings:
connectorSettingsMapuses connection names as keys. The system resolves connection names to the matching connector instance in the target environment. Legacy connector type keys (e.g.,ELASTICSEARCH_INDEX) continue to work for backward compatibility. - Method Overrides: Method-level overrides take precedence over proxy-level settings. Use
apiMethodIdto identify methods;apiMethodNameis optional and stored for display.
Permissions
User must have API_MANAGEMENT + MANAGE permission in the project.
Related Documentation
- Get Traffic Log Settings - Get settings for environment
- Update Method Override - Update method-level override
- Delete Method Override - Delete method-level override