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,
"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

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.
methodOverrideListarrayNo[]Method-level override list. Only methods that differ from proxy-level settings need entries here.
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

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[]
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
}
not

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

Permissions

User must have API_MANAGEMENT + MANAGE permission in the project.