Skip to content
Start here

Set payload log settings

client.ZeroTrust.DLP.PayloadLogs.Update(ctx, params) (*DLPPayloadLogUpdateResponse, error)
PUT/accounts/{account_id}/dlp/payload_log

Enables or disables payload logging for DLP matches. When enabled, matched content is stored for review.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Zero Trust Write
ParametersExpand Collapse
params DLPPayloadLogUpdateParams
AccountID param.Field[string]

Path param

MaskingLevel param.Field[DLPPayloadLogUpdateParamsMaskingLevel]Optional

Body param: Masking level for payload logs.

  • full: The entire payload is masked.
  • partial: Only partial payload content is masked.
  • clear: No masking is applied to the payload content.
  • default: DLP uses its default masking behavior.
const DLPPayloadLogUpdateParamsMaskingLevelFull DLPPayloadLogUpdateParamsMaskingLevel = "full"
const DLPPayloadLogUpdateParamsMaskingLevelPartial DLPPayloadLogUpdateParamsMaskingLevel = "partial"
const DLPPayloadLogUpdateParamsMaskingLevelClear DLPPayloadLogUpdateParamsMaskingLevel = "clear"
const DLPPayloadLogUpdateParamsMaskingLevelDefault DLPPayloadLogUpdateParamsMaskingLevel = "default"
PublicKey param.Field[string]Optional

Body param: Base64-encoded public key for encrypting payload logs.

  • Set to null or empty string to disable payload logging.
  • Set to a non-empty base64 string to enable payload logging with the given key.

For customers with configurable payload masking feature rolled out:

  • If the field is missing, the existing setting will be kept. Note that this is different from setting to null or empty string.

For all other customers:

  • If the field is missing, the existing setting will be cleared.
ReturnsExpand Collapse
type DLPPayloadLogUpdateResponse struct{…}
UpdatedAt Time
formatdate-time
MaskingLevel DLPPayloadLogUpdateResponseMaskingLevelOptional

Masking level for payload logs.

  • full: The entire payload is masked.
  • partial: Only partial payload content is masked.
  • clear: No masking is applied to the payload content.
  • default: DLP uses its default masking behavior.
One of the following:
const DLPPayloadLogUpdateResponseMaskingLevelFull DLPPayloadLogUpdateResponseMaskingLevel = "full"
const DLPPayloadLogUpdateResponseMaskingLevelPartial DLPPayloadLogUpdateResponseMaskingLevel = "partial"
const DLPPayloadLogUpdateResponseMaskingLevelClear DLPPayloadLogUpdateResponseMaskingLevel = "clear"
const DLPPayloadLogUpdateResponseMaskingLevelDefault DLPPayloadLogUpdateResponseMaskingLevel = "default"
PublicKey stringOptional

Base64-encoded public key for encrypting payload logs. Null when payload logging is disabled.

Set payload log settings

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/zero_trust"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  payloadLog, err := client.ZeroTrust.DLP.PayloadLogs.Update(context.TODO(), zero_trust.DLPPayloadLogUpdateParams{
    AccountID: cloudflare.F("account_id"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", payloadLog.UpdatedAt)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "updated_at": "2019-12-27T18:11:19.117Z",
    "masking_level": "full",
    "public_key": "public_key"
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "updated_at": "2019-12-27T18:11:19.117Z",
    "masking_level": "full",
    "public_key": "public_key"
  }
}