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,
"overrideEnvironmentRestrictions": false,
"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
The Default column is the value a newly created settings document starts with. On an update, a field you do not send is not reset to its default — it keeps whatever is currently stored.
| 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. Sent as a whole: the object you send replaces the stored one, and an empty object clears every per-connector setting. | |
| methodOverrideList | array | No | [] | Method-level override list. Only methods that differ from proxy-level settings need entries here. Sent as a whole: the array you send replaces the stored one, and an empty array clears every override. |
| retentionProfile | string | No | null | Data retention profile for this proxy in this environment: STANDARD, NO_PAYLOAD or NO_PERSIST. null inherits the effective profile from the project and global settings. A proxy can only make retention stricter than the layers above it. |
| overrideEnvironmentRestrictions | boolean | No | false | Exempts this API Proxy from the detail filter and body size limits configured on the environment connector. Works on its own — no connector-side setting is required. Never skips privacy masking or the data retention profile. See the note below. |
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.
This endpoint applies only the fields present in the request body. Omitting a field, or sending it as null, keeps the value that is currently stored — including flags an operator deliberately turned off. Log flags default to true only when the settings document is created for the first time.
This matters most for automation: a call that changes one setting (a retention profile, a single connector) cannot silently re-enable body logging or wipe the per-connector settings it never mentioned. To change a value you must send it explicitly.
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
}
}
}'
cURL Example: Partial Update
Changing one field only. Every log flag, the per-connector settings and the method overrides stay exactly as they are stored:
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 '{
"retentionProfile": "NO_PAYLOAD"
}'
Notes and Warnings
- Partial update: Only the fields you send are applied. An omitted field keeps its stored value, so a narrow automation call never resets settings it does not mention. Send a field explicitly (including
false) to change it. - 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. - Overriding environment restrictions:
overrideEnvironmentRestrictionsis a one-sided switch — no connector-side setting is required. When set totrue, every environment connector's field filter and body size caps are skipped for this proxy only; every other proxy keeps the restrictions unchanged. Omitting the field, or sendingfalse, keeps the environment connector's restrictions in effect (an omitted field keeps whatever value is currently stored, per the partial-update behavior above). - What the override never skips: privacy settings (masking, hashing, deletion, encryption) are applied to every record regardless, and the data retention profile is unaffected — under
no-payloadorno-persistno body is captured at all. SendingoverrideEnvironmentRestrictionstherefore cannot widen what a stricter retention profile allows.
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