Skip to content

Get Rule



GET /api/v1/sensitive_data_scanner/{sensitive_rule_uuid}/get

Overview

Get a valid rule.

Before You Call and Usage Steps

Get a valid rule. Obtain the path UUID from content.data[].uuid in the rule list or from content.ruleUUIDs[0] in the create response. The data scope is the workspace that the API Key belongs to.

Route Parameters

Parameter Name Type Required Description
sensitive_rule_uuid string Y Rule UUID in the current workspace.
Allows null: False
Maximum length: 48
Example: sdsr_32cc36108f2c4194a70fc12554583f20
How to obtain: Get content.data[].uuid from the Sensitive Data Scanning rule list, or content.ruleUUIDs[] from the create response.

Request Headers

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

Additional Parameter Notes

Returns the editable configuration, status, and creation and modification information of the rule. UUIDs from other workspaces or deleted UUIDs return an object-not-exists error.

Request Example

curl 'https://openapi.truewatch.com/api/v1/sensitive_data_scanner/sdsr_32cc36108f2c4194a70fc12554583f20/get' \
  -H 'DF-API-KEY: <DF-API-KEY>'

Response

HTTP 200, application/json.

Field Type Description
content.uuid string Rule UUID, used for query, modification, enabling or disabling, and deletion.
content.workspaceUUID string UUID of the workspace that the rule belongs to.
content.name string Rule name.
content.dataTypes array<string> Data types that the rule applies to.
content.filters array<object> Configured filter conditions.
content.conditions string Server-derived filter expression.
content.regularExpression string Rule regular expression.
content.maskFieldCfg object Scanned field configuration.
content.maskTypeCfg object Masking configuration.
content.tags array<string> Rule tags.
content.status integer 0 enabled, 2 disabled.
content.createAt integer Creation time, in Unix seconds.
content.updateAt integer Update time, in Unix seconds; may be -1 if never updated.
content.deleteAt integer Deletion time; -1 for active records.
content.id integer or null Database row ID. Use uuid for integration.
content.creator string Identifier of the creating principal.
content.updator string Identifier of the last updating principal.
{
    "code": 200,
    "content": {
        "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
    },
    "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 not supported by the current workspace edition Forbidden Verify the workspace that the key belongs to, the permissions, and the workspace edition.
406 ft.ParameterValidationFailed / ft.InvalidParameter Missing fields or field values violate validation constraints Invalid parameter Check the JSON fields, types, and value ranges.
404 ft.ObjectNotExists The rule does not exist, has been deleted, or does not belong to the current workspace Rule does not exist Obtain the UUID again from the rule list of the current workspace.