Query Security Detection Rule List¶
GET /api/v1/security_rule/list
Overview¶
Query a paginated summary of security detection rules in the current workspace.
Before You Begin and Usage Steps¶
Query by page within the current workspace. Regular detection supports multiple type values separated by English commas; when detectionMethod=ai, type is ignored. Defaults are page 1 with 50 items per page, and pageSize can be set from 1 to 100.
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | Workspace API Key with security monitoring configuration management permissions. Example: <DF-API-KEY>How to obtain or fill in: Obtain the Key required by this API from API Key management in the target workspace. |
Query Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| type | commaArray | Rule type, supporting multiple values separated by English commas. Available types are siem, cspm, aba, and ai_monitor. This parameter is ignored when the detection method is ai. Allows null: False Example: siem,cspm How to obtain or fill in: To query multiple rule types, separate the values with English commas. |
|
| detectionMethod | string | Detection method. ai indicates AI rules, regular indicates regular rules. Allows null: False Optional values: ['ai', 'regular'] Example: aiHow to obtain or fill in: Pass ai to query AI rules and regular to query regular rules. |
|
| pageIndex | integer | Page number, default 1. Allows null: False $minValue: 1 Example: 1How to obtain or fill in: Start from page 1 for the first query and increment as needed. |
|
| pageSize | integer | Number of items per page, default 50, maximum 100. Allows null: False $minValue: 1 $maxValue: 100 Example: 50How to obtain or fill in: Enter the number of rules needed per page, up to 100. |
Request Example¶
curl 'https://openapi.truewatch.com/api/v1/security_rule/list?type=siem,cspm&detectionMethod=regular' \
-H 'DF-API-KEY: <DF-API-KEY>'
Response¶
HTTP 200, application/json.
| Field | Type | Description |
|---|---|---|
| content.data[].uuid | string | Security rule UUID. |
| content.data[].name | string | Rule name. |
| content.data[].type | string | Rule type. |
| content.data[].status | integer | Rule status. 0 enabled, 2 disabled. |
| content.data[].updateAt | integer | Update time, in Unix seconds. May be -1 if never updated. |
| content.declaration | object | Public declaration of the current workspace. |
| content.statusStatistics | object | Aggregated counts by jsonScript.checkerOpt.status (severity) for regular rules matching the filter conditions before pagination. AI rules are not counted. |
| pageInfo | object | Pagination information. |
{
"code": 200,
"content": {
"data": [
{
"uuid": "srul_example",
"name": "SIEM 示例",
"type": "siem",
"status": 0,
"updateAt": 1795737600
}
],
"statusStatistics": {
"high": 1
},
"declaration": {}
},
"pageInfo": {
"pageIndex": 1,
"pageSize": 50,
"count": 1,
"totalCount": 1
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Response¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Resolution |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed / ft.InvalidParameter | A field is missing, or its type or configuration does not meet requirements | Invalid parameter | Check the fields and values against the request parameter table. |
| 403 | ft.Forbidden | The API Key lacks permission for this API, or has no operation rights on the target AI rule | Forbidden | Confirm the Key's workspace, permissions, and target rule. |
| 400 | ft.UnsupportFreeWorkspaceSecurityCfg | The current workspace plan does not support security configuration | Plan not supported | Confirm the target workspace plan. |