Skip to content

Rule List



GET /api/v1/sensitive_data_scanner/list

Overview

Lists the Sensitive Data Scanning rules in the current workspace with pagination.

Before Calling and Usage Steps

Lists the Sensitive Data Scanning rules in the current workspace with pagination. Search uses literal substring matching and applies no filter by default. The default is page 1 with 20 items per page; pageSize ranges from 1 to 100. Results are sorted by creation time and UUID in ascending order. The data scope is the workspace to which the API Key belongs.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y Access key.
Example: <DF-API-KEY>
How to obtain or enter: Obtain the key required by this API from API Key management in the target workspace.

Query Parameters

Parameter Type Required Description
search string Search by name substring. If omitted, all rules are queried.
Null allowed: False
Maximum length: 128
Empty string allowed: True
Example: payment
How to obtain or enter: Enter a search keyword based on the rule name.
pageIndex integer Page number, starting from 1. Default: 1.
Null allowed: False
$minValue: 1
$maxValue: 2147483647
Example: 1
How to obtain or enter: Start from page 1 for the first query and increment as needed for subsequent queries.
pageSize integer 1–100 items per page. Default: 20.
Null allowed: False
$minValue: 1
$maxValue: 100
Example: 20
How to obtain or enter: Enter the number of items required per page, from 1 to 100.

Additional Parameter Information

Searches rules in the current workspace by name, including enabled and disabled rules. Sorts by creation time and UUID and uses database pagination.

Request Example

curl 'https://openapi.truewatch.com/api/v1/sensitive_data_scanner/list?search=payment&pageIndex=1&pageSize=20' \
  -H 'DF-API-KEY: <DF-API-KEY>'

Response

HTTP 200, application/json.

Field Type Description
content.data[].uuid string Rule UUID, used to query, modify, enable, disable, or delete the rule.
content.data[].workspaceUUID string UUID of the workspace to which the rule belongs.
content.data[].name string Rule name.
content.data[].dataTypes array<string> Data types to which the rule applies.
content.data[].filters array<object> Configured filter conditions.
content.data[].conditions string Server-derived filter expression.
content.data[].regularExpression string Rule regular expression.
content.data[].maskFieldCfg object Scan field configuration.
content.data[].maskTypeCfg object Mask configuration.
content.data[].tags array<string> Rule tags.
content.data[].status integer 0 enabled, 2 disabled.
content.data[].createAt integer Creation time, in Unix seconds.
content.data[].updateAt integer Update time, in Unix seconds. May be -1 if never updated.
content.data[].deleteAt integer Deletion time. -1 for active records.
content.data[].id integer or null Database row ID. Use uuid for integration.
content.data[].creator string Identifier of the creating principal.
content.data[].updator string Identifier of the last updating principal.
content.declaration object Public declaration of the current workspace.
pageInfo object Pagination information.
{
  "code": 200,
  "content": {
    "data": [
      {
        "uuid": "sdsr_32cc36108f2c4194a70fc12554583f20",
        "dataTypes": [
          "logging"
        ],
        "filters": [
          {
            "name": "service",
            "operation": "in",
            "value": [
              "payment",
              "checkout"
            ],
            "condition": "or"
          },
          {
            "name": "env",
            "operation": "not_in",
            "value": [
              "test"
            ],
            "condition": "or"
          }
        ],
        "maskFieldCfg": {
          "type": "include",
          "fields": [
            "message"
          ]
        },
        "maskTypeCfg": {
          "type": "part",
          "partMaskCfg": {
            "type": "front",
            "count": 3
          }
        },
        "name": "payment-email",
        "regularExpression": "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}",
        "tags": [
          "masked:email"
        ],
        "status": 0,
        "creator": "acnt_example",
        "updator": "",
        "createAt": 1795140000,
        "updateAt": -1
      }
    ],
    "declaration": {}
  },
  "pageInfo": {
    "pageIndex": 1,
    "pageSize": 20,
    "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 Handling
403 ft.Forbidden Insufficient API permissions, or the current workspace version does not support this feature Forbidden Confirm the workspace to which the Key belongs, the permissions, and the workspace version.
406 ft.ParameterValidationFailed / ft.InvalidParameter Missing fields or field values that violate validation constraints Invalid parameters Check the JSON fields, types, and value ranges.