Ana içeriğe atla

Endpoint

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

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer 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,
  "enableElasticsearchConnector": true,
  "connectorSettingsMap": {
    "Production Elasticsearch": {
      "enabled": true,
      "logBodyRequestFromClient": true,
      "logBodyResponseFromTarget": true,
      "enableBodyFromClientSize": true,
      "sizeBodyFromClient": 1024
    }
  },
  "methodOverrideList": [
    {
      "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
enableDatabaseConnectorbooleanNofalseEnable database connector
enableElasticsearchConnectorbooleanNofalseEnable Elasticsearch connector
enableSyslogConnectorbooleanNofalseEnable Syslog connector
enableWebhookConnectorbooleanNofalseEnable Webhook connector
enableRabbitMqConnectorbooleanNofalseEnable RabbitMQ connector
enableActiveMqConnectorbooleanNofalseEnable ActiveMQ connector
enableKafkaConnectorbooleanNofalseEnable Kafka connector
enableGraylogConnectorbooleanNofalseEnable Graylog connector
enableLogbackConnectorbooleanNofalseEnable Logback connector
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.
methodOverrideList[]
FieldTypeRequiredDescription
apiMethodNamestringYesAPI method endpoint path (e.g., /pets, /users/{id})
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
}

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,
    "enableElasticsearchConnector": 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 apiMethodName (the endpoint path) to identify methods.

Permissions

User must have API_MANAGEMENT + MANAGE permission in the project.