Help Center/ CodeArts Check/ API Reference/ APIs/ Rule Management/ Querying Rule Sets - Version 2
Updated on 2026-02-03 GMT+08:00

Querying Rule Sets - Version 2

Function

This API is used to query the rule set list and return the rule set details. You can filter the result by language and rule set name.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

codeartscheck::listRuleSets

List

-

-

-

-

URI

GET /v2/all-criterionsets

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

languages

No

String

Definition:

Rule languages. Use commas (,) to separate multiple languages.

Constraints:

N/A

Value range:

  • ArkTS

  • C#

  • Cangjie

  • C++

  • CSS

  • Go

  • HTML

  • Java

  • JavaScript

  • Kotlin

  • Lua

  • PHP

  • Python

  • Rust

  • Scala

  • Shell

  • SQL

  • Terraform

  • TypeScript

Default value:

N/A

search

No

String

Definition:

Search keyword.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

page_size

No

Integer

Definition:

Number of rule sets on each page.

Constraints:

N/A

Value range:

1–50

Default value:

10

page

No

Integer

Definition:

Total number of pages.

Constraints:

N/A

Value range:

0–999

Default value:

1

my_create

No

String

Definition:

Whether to query the rule sets created by me.

Constraints:

N/A

Value range:

  • true: Query the rule sets created by me.

  • false: Query all rule sets.

Default value:

false

project_id

No

String

Definition :

32-character project UUID. Obtain it by calling the API used to query the project list.

Constraints:

N/A

Value range:

1 to 128 characters, including letters and digits.

Default value:

N/A

is_call_status

No

String

Definition:

Whether to query the usage status.

Constraints:

N/A

Value range:

  • true: Query the usage status of a rule set.

  • false: Do not query the usage status of a rule set.

Default value:

true.

sort_field

No

String

Definition:

Sorting parameter.

Constraints:

N/A

Value range:

  • num_criterion: Sort by the number of enabled rules.

  • last_update_time: Sort by latest update time.

Default value:

N/A

sort_order

No

String

Definition:

Sorting parameter.

Constraints:

N/A

Value range:

  • up: ascending order

  • down: descending order

Default value:

up.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition :

User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token.

Constraints:

N/A

Value range:

1–100,000 characters.

Default value:

N/A

operator

No

String

Definition:

Operator username.

Constraints:

N/A

Value range:

1 to 128 characters.

Default value:

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

httpStatus

String

Definition:

HTTP response status.

Value range:

  • OK: The request has been successfully processed, and the server returns the requested resource or operation result.

  • ACCEPTED: The request has been accepted by the server, but the processing is not complete (usually used for asynchronous operations).

  • INTERNAL_SERVER_ERROR: internal API exception.

  • BAD_REQUEST: abnormal parameter verification.

result

CriterionSetsInfo object

Definition:

Rule list.

Range:

N/A

status

String

Definition:

API response status.

Value range:

  • success: successful response.

  • error: response failed.

Table 4 CriterionSetsInfo

Parameter

Type

Description

criterionSetList

Array of CriterionSetListV2Body objects

Definition:

Rule list.

Range:

N/A

total

Integer

Definition:

Total number of rules.

Value range:

≥0

Table 5 CriterionSetListV2Body

Parameter

Type

Description

id

String

Definition:

Rule set ID.

Value range:

N/A

name

String

Definition:

Rule set name in Chinese.

Range:

N/A

comments

String

Definition:

Rule set description in Chinese.

Range:

N/A

type

String

Definition:

Rule set type.

Value range:

  • system: system rule set.

  • custom: custom rule set.

creator

String

Definition:

Rule set creator.

Range:

Username.

createTime

String

Definition:

Time when a rule set is created.

Range:

Coordinated universal time.

lastReviser

String

Definition:

Latest operator of a rule set.

Range:

Username.

lastUpdateTime

String

Definition:

Time when the rule set was last updated.

Range:

Coordinated universal time.

language

String

Definition:

Rule set language.

Value range:

  • ArkTS

  • C#

  • Cangjie

  • C++

  • CSS

  • Go

  • HTML

  • Java

  • JavaScript

  • Kotlin

  • Lua

  • PHP

  • Python

  • Rust

  • Scala

  • Shell

  • SQL

  • Terraform

  • TypeScript

parentId

String

Definition:

Parent rule set ID.

Value range:

32-character UUID string. Use commas (,) to separate multiple IDs.

numCriterion

Integer

Definition:

Number of enabled rules in a rule set.

Value range:

≥0

canEdit

Boolean

Definition:

Whether the current user has the permission to edit the rule set.

Value range:

  • true: The edit permission is granted.

  • false: The edit permission is not granted.

canDelete

Boolean

Definition:

Whether the current user has the permission to delete the rule set.

Value range:

  • true: The delete permission is granted.

  • false: The delete permission is not granted.

managers

String

Definition:

Rule set administrator.

Value range:

User ID. Use commas (,) to separate multiple IDs.

parentSetNames

String

Definition:

Name of a parent rule set.

Range:

Use commas (,) to separate multiple rule set names.

domainId

String

Definition:

Tenant ID.

Value range:

32-character UUID.

inheritMode

String

Definition:

Inheritance type.

Value range:

  • strong: inherited.

  • null: non-inherited.

creatorId

String

Definition:

Creator ID.

Value range:

32-character UUID.

isSystemDefault

String

Definition:

Whether the rule set is the default rule set of the system.

Value range:

  • 0: no.

  • 1: yes.

isProjectDefault

String

Definition:

Whether the rule set is the default rule set of the project.

Value range:

  • 0: no.

  • 1: yes.

isSystemSet

String

Definition:

Whether the rule set is a system rule set.

Value range:

  • 0: no.

  • 1: yes.

ruleIds

String

Definition:

Unique ID of an enabled capability rule in the rule set.

Value range:

32-character UUID. Use commas (,) to separate multiple IDs.

region

String

Definition:

Region where the rule set is located.

Range:

N/A

canSetDefault

Boolean

Definition:

Whether the user has the permission to set the default rule set.

Value range:

  • true: The user has the permission.

  • false: The user does not have the permission.

isUsed

Boolean

Definition:

Whether the rule set is in use.

Value range:

  • true: yes.

  • false: no.

childSets

Array of strings

Definition:

Sub-rule set.

Range:

N/A

isReliable

Boolean

Definition:

Whether the rule set is trusted. This field has been deprecated.

Value range:

  • true: yes.

  • false: no.

isRecommand

String

Definition:

Whether the rule set is recommended. This field has been deprecated.

Value range:

  • 1: yes.

  • 0: no.

isDefault

Boolean

Definition:

Whether the rule set is the default rule set. This field has been deprecated.

Value range:

  • true: yes.

  • false: no.

defaultSet

String

Definition:

Whether the rule set is the default rule set. This field has been deprecated.

Value range:

  • true: yes.

  • false: no.

deptId

String

Definition:

This field has been discarded.

Range:

N/A

deptName

String

Definition:

This field has been discarded.

Range:

N/A

reliableTag

String

Definition:

This field has been discarded.

Range:

N/A

recommandType

String

Definition:

This field has been discarded.

Range:

N/A

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error code.

Value range:

N/A

error_msg

String

Definition:

Error message.

Value range:

N/A

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error code.

Value range:

N/A

error_msg

String

Definition:

Error message.

Value range:

N/A

Example Requests

GET https://{endpoint}/v2/all-criterionsets?project_id=8c7c74775f4f496596e4a39d34b209c3&languages=JAVA&page=1&page_size=10&is_call_status=false

Example Responses

Status code: 200

query criterionsets

{
  "httpStatus" : "OK",
  "result" : {
    "criterionSetList" : [ {
      "businessId" : "",
      "businessName" : "",
      "canDelete" : true,
      "canEdit" : true,
      "childSets" : [ ],
      "comments" : "",
      "createTime" : "2020-11-13 15:35:06.0",
      "creator" : "SYSTEM",
      "creatorId" : "",
      "deptId" : "",
      "deptName" : "",
      "detecteObjType" : "biz_code",
      "id" : "24519a31060141708a0c61c1ac75e672",
      "isProjectDefault" : "0",
      "isRecommand" : "0",
      "isReliable" : true,
      "isSystemDefault" : "0",
      "isSystemSet" : "0",
      "lastReviser" : "SYSTEM",
      "lastUpdateTime" : "2020-11-13 15:35:06",
      "managers" : "",
      "name" : "3 layer operations rule set",
      "numCriterion" : 0,
      "order" : 1,
      "parentFolderId" : "",
      "parentSetNames" : "",
      "recommandType" : "0",
      "reliableTag" : "",
      "type" : "dir"
    } ],
    "total" : 1
  },
  "status" : "success"
}

Status code: 400

Bad Request

{
  "error_code" : "CC.xxxxxxxx.400",
  "error_msg" : "Verify request parameter failed. Check whether the request parameters are correct."
}

Status code: 401

Unauthorized

{
  "error_code" : "CC.00000003",
  "error_msg" : "Authentication information expired."
}

Status Codes

Status Code

Description

200

query criterionsets

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.