Skip to content
Start here

Get DLP account-level settings.

client.ZeroTrust.DLP.Settings.Get(ctx, query) (*DLPSettings, error)
GET/accounts/{account_id}/dlp/settings

Get DLP account-level settings.

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 ReadZero Trust Write
ParametersExpand Collapse
query DLPSettingGetParams
AccountID param.Field[string]
ReturnsExpand Collapse
type DLPSettings struct{…}

DLP account-level settings response.

AIContextAnalysis bool

Whether AI context analysis is enabled at the account level.

OCR bool

Whether OCR is enabled at the account level.

PayloadLogging DLPSettingsPayloadLogging
UpdatedAt Time
formatdate-time
MaskingLevel DLPSettingsPayloadLoggingMaskingLevelOptional

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 DLPSettingsPayloadLoggingMaskingLevelFull DLPSettingsPayloadLoggingMaskingLevel = "full"
const DLPSettingsPayloadLoggingMaskingLevelPartial DLPSettingsPayloadLoggingMaskingLevel = "partial"
const DLPSettingsPayloadLoggingMaskingLevelClear DLPSettingsPayloadLoggingMaskingLevel = "clear"
const DLPSettingsPayloadLoggingMaskingLevelDefault DLPSettingsPayloadLoggingMaskingLevel = "default"
PublicKey stringOptional

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

Get DLP account-level 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"),
  )
  dlpSettings, err := client.ZeroTrust.DLP.Settings.Get(context.TODO(), zero_trust.DLPSettingGetParams{
    AccountID: cloudflare.F("account_id"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", dlpSettings.AIContextAnalysis)
}
{
  "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": {
    "ai_context_analysis": true,
    "ocr": true,
    "payload_logging": {
      "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": {
    "ai_context_analysis": true,
    "ocr": true,
    "payload_logging": {
      "updated_at": "2019-12-27T18:11:19.117Z",
      "masking_level": "full",
      "public_key": "public_key"
    }
  }
}