Skip to content
Start here

Get all behaviors and associated configuration

zero_trust.risk_scoring.behaviours.get(BehaviourGetParams**kwargs) -> BehaviourGetResponse
GET/accounts/{account_id}/zt_risk_scoring/behaviors

Retrieves configured risk score behaviors that define how user actions affect their overall risk score.

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
account_id: str
ReturnsExpand Collapse
class BehaviourGetResponse:
behaviors: Dict[str, Behaviors]
description: str
enabled: bool
name: str
risk_level: Literal["low", "medium", "high"]
One of the following:
"low"
"medium"
"high"

Get all behaviors and associated configuration

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
behaviour = client.zero_trust.risk_scoring.behaviours.get(
    account_id="account_id",
)
print(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": {
        "description": "description",
        "enabled": true,
        "name": "name",
        "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": {
        "description": "description",
        "enabled": true,
        "name": "name",
        "risk_level": "low"
      }
    }
  }
}