Ana içeriğe geç

Update Traffic Log Settings

Endpoint

PUT /apiops/projects/{projectName}/apiProxies/{apiProxyName}/trafficLogSettings/{environmentName}/

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
environmentNamestringYesEnvironment 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.

FieldTypeRequiredDefaultDescription
logParamRequestFromClientbooleanNotrueLog query parameters from client request
logHeaderRequestFromClientbooleanNotrueLog headers from client request
logBodyRequestFromClientbooleanNotrueLog body from client request
logParamRequestToTargetbooleanNotrueLog query parameters sent to target
logHeaderRequestToTargetbooleanNotrueLog headers sent to target
logBodyRequestToTargetbooleanNotrueLog body sent to target
logHeaderResponseFromTargetbooleanNotrueLog headers from target response
logBodyResponseFromTargetbooleanNotrueLog body from target response
logHeaderResponseToClientbooleanNotrueLog headers sent to client response
logBodyResponseToClientbooleanNotrueLog body sent to client response
connectorSettingsMapobjectNoPer-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.
methodOverrideListarrayNo[]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.
retentionProfilestringNonullData 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.
overrideEnvironmentRestrictionsbooleanNofalseExempts 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.
Legacy fields

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.

Partial update behavior

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[]
FieldTypeRequiredDescription
apiMethodIdstringYesAPI method ID. Used at runtime to match the override to the method.
apiMethodNamestringNoAPI method endpoint path (e.g., /pets, /users/{id}). Stored for display; matching uses apiMethodId.
connectorSettingsMapobjectNoPer-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
}
Note

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: connectorSettingsMap uses 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 apiMethodId to identify methods; apiMethodName is optional and stored for display.
  • Overriding environment restrictions: overrideEnvironmentRestrictions is a one-sided switch — no connector-side setting is required. When set to true, 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 sending false, 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-payload or no-persist no body is captured at all. Sending overrideEnvironmentRestrictions therefore cannot widen what a stricter retention profile allows.

Permissions

User must have API_MANAGEMENT + MANAGE permission in the project.