# Behaviours ## 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. ### Parameters - `account_id: str` ### Returns - `class BehaviourGetResponse: …` - `behaviors: Dict[str, Behaviors]` - `description: str` - `enabled: bool` - `name: str` - `risk_level: Literal["low", "medium", "high"]` - `"low"` - `"medium"` - `"high"` ### Example ```python 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) ``` #### Response ```json { "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" } } } } ``` ## Update configuration for risk behaviors `zero_trust.risk_scoring.behaviours.update(BehaviourUpdateParams**kwargs) -> BehaviourUpdateResponse` **put** `/accounts/{account_id}/zt_risk_scoring/behaviors` Updates risk score behavior configurations, defining weights and thresholds for risk calculation. ### Parameters - `account_id: str` - `behaviors: Dict[str, Behaviors]` - `enabled: bool` - `risk_level: Literal["low", "medium", "high"]` - `"low"` - `"medium"` - `"high"` ### Returns - `class BehaviourUpdateResponse: …` - `behaviors: Dict[str, Behaviors]` - `enabled: bool` - `risk_level: Literal["low", "medium", "high"]` - `"low"` - `"medium"` - `"high"` ### Example ```python 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.update( account_id="account_id", behaviors={ "foo": { "enabled": True, "risk_level": "low", } }, ) print(behaviour.behaviors) ``` #### Response ```json { "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" } } } } ``` ## Domain Types ### Behaviour Get Response - `class BehaviourGetResponse: …` - `behaviors: Dict[str, Behaviors]` - `description: str` - `enabled: bool` - `name: str` - `risk_level: Literal["low", "medium", "high"]` - `"low"` - `"medium"` - `"high"` ### Behaviour Update Response - `class BehaviourUpdateResponse: …` - `behaviors: Dict[str, Behaviors]` - `enabled: bool` - `risk_level: Literal["low", "medium", "high"]` - `"low"` - `"medium"` - `"high"`