Skip to content
Start here

Get all behaviors and associated configuration

client.ZeroTrust.RiskScoring.Behaviours.Get(ctx, query) (*RiskScoringBehaviourGetResponse, error)
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
query RiskScoringBehaviourGetParams
AccountID param.Field[string]
ReturnsExpand Collapse
type RiskScoringBehaviourGetResponse struct{…}
Behaviors map[string, RiskScoringBehaviourGetResponseBehavior]
Description string
Enabled bool
Name string
RiskLevel RiskScoringBehaviourGetResponseBehaviorsRiskLevel
One of the following:
const RiskScoringBehaviourGetResponseBehaviorsRiskLevelLow RiskScoringBehaviourGetResponseBehaviorsRiskLevel = "low"
const RiskScoringBehaviourGetResponseBehaviorsRiskLevelMedium RiskScoringBehaviourGetResponseBehaviorsRiskLevel = "medium"
const RiskScoringBehaviourGetResponseBehaviorsRiskLevelHigh RiskScoringBehaviourGetResponseBehaviorsRiskLevel = "high"

Get all behaviors and associated configuration

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"),
  )
  behaviour, err := client.ZeroTrust.RiskScoring.Behaviours.Get(context.TODO(), zero_trust.RiskScoringBehaviourGetParams{
    AccountID: cloudflare.F("account_id"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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"
      }
    }
  }
}