Updated on 2025-08-13 GMT+08:00

List of User-Defined Rules

Function

List all user-defined parsing rules.

URI

GET /v1/koosearch/rule-regex

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Parameter description:

Token used for API authentication. For how to obtain the token, see section 3.2 "Authentication."

Constraints:

N/A.

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

rules

Array of RuleRegexInfo objects

List of configured rule parsing rules.

Table 3 RuleRegexInfo

Parameter

Type

Description

id

String

Rule ID.

regexs

Array of strings

User-defined rule content.

project_id

String

Project ID of the user who creates the rule.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error description

Status code: 500

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error description

Example Requests

None

Example Responses

Status code: 200

List of user-defined rules.

{
  "rules" : [ {
    "id" : "1849381761142775810",
    "regexs" : [ "^example.+$" ]
  }, {
    "id" : "1851107852563800066",
    "regexs" : [ "^(\\d+)\\s*[\\u4e00-\\u9fa5]+$", "^(\\d+)(\\.\\d+)\\s*[\\u4e00-\\u9fa5]+$", "^(\\d+)(\\.\\d+)(\\.\\d+)\\s*[\\u4e00-\\u9fa5]+$" ]
  } ]
}

Status Codes

Status Code

Description

200

List of user-defined rules.

400

Incorrect request body parameter

500

Internal error

Error Codes

See Error Codes.