Skip to content
Start here

Update configuration for risk behaviors

client.zeroTrust.riskScoring.behaviours.update(BehaviourUpdateParams { account_id, behaviors } params, RequestOptionsoptions?): BehaviourUpdateResponse { behaviors }
PUT/accounts/{account_id}/zt_risk_scoring/behaviors

Updates risk score behavior configurations, defining weights and thresholds for risk calculation.

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: BehaviourUpdateParams { account_id, behaviors }
account_id: string

Path param: Account ID.

behaviors: Record<string, Behaviors>

Body param

enabled: boolean
risk_level: "low" | "medium" | "high"
One of the following:
"low"
"medium"
"high"
ReturnsExpand Collapse
BehaviourUpdateResponse { behaviors }
behaviors: Record<string, Behaviors>
enabled: boolean
risk_level: "low" | "medium" | "high"
One of the following:
"low"
"medium"
"high"

Update configuration for risk behaviors

import Cloudflare from 'cloudflare';

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

const behaviour = await client.zeroTrust.riskScoring.behaviours.update({
  account_id: 'account_id',
  behaviors: { foo: { enabled: true, risk_level: 'low' } },
});

console.log(behaviour.behaviors);
{
  "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": {
    "behaviors": {
      "foo": {
        "enabled": true,
        "risk_level": "low"
      }
    }
  }
}
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": {
    "behaviors": {
      "foo": {
        "enabled": true,
        "risk_level": "low"
      }
    }
  }
}