Updated on 2025-09-17 GMT+08:00

Querying All Bot Protection Rules

Function

This API is used to query all bot protection rules.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/waf/policy/{policy_id}/bot-manager

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Tenant project ID, which is used to identify the project to which the tenant belongs. To obtain the project ID, log in to the console, click the username, choose My Credentials, locate the project in the Projects list, and check the project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

policy_id

Yes

String

Definition

Policy ID, which is the unique identifier of a protection policy. You can obtain the policy ID by calling the API for querying the protection policy list.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

Authentication token, or tenant token, which is used for identity authentication. You can obtain the token by calling the IAM API for obtaining a user token. The token is the value of X-Subject-Token in the response header.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

policy_id

String

Definition

Policy ID, which uniquely identifies the protection policy associated with the bot protection rule.

Constraints

N/A

Range

N/A

Default Value

N/A

tenant_id

String

Definition

Tenant ID, which uniquely identifies the tenant to which the bot protection rule belongs.

Constraints

N/A

Range

N/A

Default Value

N/A

known_bot_detection

Array of BotMRule objects

Definition

All rules related to known bots, including detection and protection rules for known bots.

Constraints

N/A

Range

N/A

Default Value

N/A

transparent_detection

Array of BotMRule objects

Definition

All rules related to transparent detection, including transparent detection rules for bots.

Constraints

N/A

Range

N/A

Default Value

N/A

behavior_detection

BotMBehaviorDetectionRule object

Definition

Behavior detection rules, including behavior analysis-based bot detection rules and protection policies.

Constraints

N/A

Range

N/A

Default Value

N/A

traffic_detection_conditions

Array of TrafficDetectionConditionDTO objects

Definition

Traffic conditions that trigger the bot detection.

Constraints

N/A

Range

N/A

Default Value

N/A

interactive_detection

Array of BotMRule objects

Definition

List of proactive feature detection rules, which contains bot detection rules that require proactive interaction verification.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 4 BotMBehaviorDetectionRule

Parameter

Type

Description

rule

BotMRule object

Definition

Behavior detection rule information, which defines basic behavior detection configurations, such as the rule name and status.

Constraints

N/A

Range

N/A

Default Value

N/A

strategy

BotMDefenseStrategy object

Definition

Protection policy corresponding to the behavior detection rule. This parameter defines the protective actions for different risk severity levels.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 5 BotMRule

Parameter

Type

Description

id

Integer

Definition

Rule ID, which uniquely identifies a bot protection rule.

Constraints

N/A

Range

N/A

Default Value

N/A

name

String

Definition

Rule name, which is used to identify a bot protection rule.

Constraints

N/A

Range

N/A

Default Value

N/A

description

String

Definition

Rule description, which describes the function of the bot protection rule.

Constraints

N/A

Range

N/A

Default Value

N/A

features

Array of strings

Definition

Rule list, which contains the specific detection features of the bot protection rule.

Constraints

N/A

Range

N/A

Default Value

N/A

category

Integer

Definition

Rule category, which indicates the level-1 category of the rule; for example, 0 indicates the basic detection category.

Constraints

N/A

Range

N/A

Default Value

N/A

sub_category

Integer

Definition

Rule subcategory, which indicates the level-2 category of the rule; for example, 0 indicates the known Bot subcategory.

Constraints

N/A

Range

N/A

Default Value

N/A

defense_action

Integer

Definition

Protective action of the rule, which indicates the action to be taken after the rule is triggered; for example, 0 indicates that the request hit the rule will be allowed.

Constraints

N/A

Range

N/A

Default Value

N/A

created_time

Long

Definition

Time when the rule was created, in milliseconds.

Constraints

N/A

Range

N/A

Default Value

N/A

modified_time

Long

Definition

Time when the rule was updated, in milliseconds.

Constraints

N/A

Range

N/A

Default Value

N/A

status

Boolean

Definition

Whether the rule is enabled. true: enabled; false: disabled.

Constraints

N/A

Range

Only true and false are supported.

Default Value

true

interaction_confidence

Integer

Definition

Interaction confidence, which indicates the confidence threshold of proactive interaction detection.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 6 BotMDefenseStrategy

Parameter

Type

Description

low

BotMDefenseLevel object

Definition

Low protection level, which corresponds to the protection configuration against low risk severity.

Constraints

N/A

Range

N/A

Default Value

N/A

medium

BotMDefenseLevel object

Definition

Medium protection level, which corresponds to the protection configuration against medium risk severity.

Constraints

N/A

Range

N/A

Default Value

N/A

high

BotMDefenseLevel object

Definition

High protection level, which corresponds to the protection configuration against high risk severity.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 7 BotMDefenseLevel

Parameter

Type

Description

threshold

Integer

Definition

Score threshold corresponding to the protection level. If the score reaches the threshold, the corresponding protective action is triggered.

Constraints

N/A

Range

N/A

Default Value

N/A

defense_action

Integer

Definition

ID of the protective action corresponding to the protection level. The action is executed after the protection level is triggered. For example, 101 indicates the verification code.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 8 TrafficDetectionConditionDTO

Parameter

Type

Description

id

String

Definition

ID, which uniquely identifies a traffic detection condition.

Constraints

N/A

Range

N/A

Default Value

N/A

match_field

String

Definition

Match field (category), which identifies the type of the field for filtering traffic. For example, url indicates the URL path.

Constraints

N/A

Range

N/A

Default Value

N/A

match_field_index

String

Definition

Subfield, which is the refined dimension of the match field. If no subfield is available, leave this parameter empty.

Constraints

N/A

Range

N/A

Default Value

N/A

logical_operator

String

Definition

Logical operator, which indicates the logical relationship of the matching condition (for example, contain indicates the condition must be included.

Constraints

N/A

Range

N/A

Default Value

N/A

match_contents

Array of strings

Definition

Match content, which is the list of specific values (for example, specific URL paths) that meet the filtering conditions.

Constraints

N/A

Range

N/A

Default Value

N/A

value_list_ref

String

Definition

Reference table ID, which is the ID of the preset match content list. If no match content list is available, leave this parameter empty.

Constraints

N/A

Range

N/A

Default Value

N/A

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

You can call the decode-authorization-message interface of the STS service to decode the rejection reason. For details, see the STS5 joint commissioning and self-verification. This parameter is returned only when an IAM 5 authentication error occurs.

details

Array of IAM5ErrorDetails objects

The set of error messages reported when a downstream service is invoked. This parameter is returned only when an IAM 5 authentication error occurs.

Table 10 IAM5ErrorDetails

Parameter

Type

Description

error_code

String

Error codes of the downstream service.

error_msg

String

Error messages of the downstream service.

Status code: 401

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

You can call the decode-authorization-message interface of the STS service to decode the rejection reason. For details, see the STS5 joint commissioning and self-verification. This parameter is returned only when an IAM 5 authentication error occurs.

details

Array of IAM5ErrorDetails objects

The set of error messages reported when a downstream service is invoked. This parameter is returned only when an IAM 5 authentication error occurs.

Table 12 IAM5ErrorDetails

Parameter

Type

Description

error_code

String

Error codes of the downstream service.

error_msg

String

Error messages of the downstream service.

Status code: 500

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

encoded_authorization_message

String

You can call the decode-authorization-message interface of the STS service to decode the rejection reason. For details, see the STS5 joint commissioning and self-verification. This parameter is returned only when an IAM 5 authentication error occurs.

details

Array of IAM5ErrorDetails objects

The set of error messages reported when a downstream service is invoked. This parameter is returned only when an IAM 5 authentication error occurs.

Table 14 IAM5ErrorDetails

Parameter

Type

Description

error_code

String

Error codes of the downstream service.

error_msg

String

Error messages of the downstream service.

Example Requests

None

Example Responses

Status code: 200

OK

{
  "policy_id" : "string",
  "tenant_id" : "string",
  "known_bot_detection" : [ {
    "id" : 0,
    "name" : "string",
    "description" : "string",
    "category" : 0,
    "sub_category" : 0,
    "defense_action" : 0,
    "created_time" : 0,
    "modified_time" : 0,
    "status" : true
  } ],
  "transparent_detection" : [ {
    "id" : 0,
    "name" : "string",
    "description" : "string",
    "category" : 0,
    "sub_category" : 0,
    "defense_action" : 0,
    "created_time" : 0,
    "modified_time" : 0,
    "status" : true
  } ],
  "behavior_detection" : {
    "rule" : {
      "id" : 0,
      "name" : "string",
      "description" : "string",
      "category" : 0,
      "sub_category" : 0,
      "defense_action" : 0,
      "created_time" : 0,
      "modified_time" : 0,
      "status" : true
    },
    "defense_strategy" : {
      "low" : {
        "threshold" : 60,
        "defense_action" : 101
      },
      "medium" : {
        "threshold" : 90,
        "defense_action" : 101
      },
      "high" : {
        "threshold" : 100,
        "defense_action" : 101
      }
    }
  },
  "traffic_detection_conditions" : [ {
    "id" : 0,
    "match_field" : "user-agent",
    "match_field_index" : "aaa",
    "logical_operator" : "contain",
    "match_contents" : [ "das" ],
    "value_list_res" : "aaaa"
  } ],
  "interactive_detection" : [ {
    "id" : 0,
    "name" : "string",
    "description" : "string",
    "category" : 0,
    "sub_category" : 0,
    "defense_action" : 0,
    "created_time" : 0,
    "modified_time" : 0,
    "status" : true,
    "interaction_confidence" : 0
  } ]
}

Status Codes

Status Code

Description

200

OK

400

Request failed.

401

The token does not have required permissions.

500

Internal server error.

Error Codes

See Error Codes.