Skip to content
Start here

Partially update DLP account-level settings.

client.zeroTrust.dlp.settings.edit(SettingEditParams { account_id, ai_context_analysis, ocr, payload_logging } params, RequestOptionsoptions?): DLPSettings { ai_context_analysis, ocr, payload_logging }
PATCH/accounts/{account_id}/dlp/settings

Missing fields keep their existing values.

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: SettingEditParams { account_id, ai_context_analysis, ocr, payload_logging }
account_id: string

Path param

ai_context_analysis?: boolean | null

Body param: Whether AI context analysis is enabled at the account level.

ocr?: boolean | null

Body param: Whether OCR is enabled at the account level.

payload_logging?: PayloadLogging

Body param: Request model for payload log settings within the DLP settings endpoint. Unlike the legacy endpoint, null and missing are treated identically here (both mean “not provided” for PATCH, “reset to default” for PUT).

masking_level?: "full" | "partial" | "clear" | "default"

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:
"full"
"partial"
"clear"
"default"
public_key?: string | null

Base64-encoded public key for encrypting payload logs.

  • Set to a non-empty base64 string to enable payload logging with the given key.
  • Set to an empty string to disable payload logging.
  • Omit or set to null to leave unchanged (PATCH) or reset to disabled (PUT).
ReturnsExpand Collapse
DLPSettings { ai_context_analysis, ocr, payload_logging }

DLP account-level settings response.

ai_context_analysis: boolean

Whether AI context analysis is enabled at the account level.

ocr: boolean

Whether OCR is enabled at the account level.

payload_logging: PayloadLogging { updated_at, masking_level, public_key }
updated_at: string
formatdate-time
masking_level?: "full" | "partial" | "clear" | "default"

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:
"full"
"partial"
"clear"
"default"
public_key?: string | null

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

Partially update DLP account-level settings.

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const dlpSettings = await client.zeroTrust.dlp.settings.edit({ account_id: 'account_id' });

console.log(dlpSettings.ai_context_analysis);
{
  "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"
    }
  }
}