Get Sensitive Field Masking Rule List¶
GET /api/v1/data_mask_rule/list
Overview¶
Lists enabled and disabled sensitive data masking rules in the current workspace with pagination.
Prerequisites and Usage Steps¶
This read endpoint declares the routine.defaultAccess basic access permission; being able to read rule information does not mean you have modification permissions.
Use an API Key for the target workspace. This group configures independent sensitive rules for the query response stage. It does not rewrite original stored data, does not create fields, and is not a permanent deletion or anonymization API.
Query by rule name; edit only after obtaining the uuid, status, full expression, and role list. search does not trim leading/trailing whitespace and performs fuzzy name search; % may still have LIKE wildcard semantics. You cannot filter by type/role through this Query; filter on the client after reading or process page by page. Pagination defaults to 100 entries per page, with a maximum of 100, in descending order by id. Displaying role information does not mean that the role can currently query data or that masking will necessarily take effect.
Effectiveness also depends on the target query chain, data category, and actual role set; role configuration is not data query authorization itself. When the same account/Key has multiple roles with query permission for the category, if one of the roles has no applicable sensitive rule, this group of rules may not be applied at all. Do not assume that all readers are forcibly masked just because one role is bound; verify with the actual role/Key in Query Data and on the target display surface. The current regex replacement handles string values only; numbers, objects, arrays, booleans, and null are not automatically converted to strings for masking. For standard query matching, the matching string portion is replaced with *, and other text is retained. Regex validation at save time uses the regex library, while the query execution path uses standard re. It is recommended to use only syntax compatible with Python's standard re.
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | Workspace OpenAPI authentication credential. Example: <DF-API-KEY>How to obtain or enter: Obtain an OpenAPI Key with this operation permission from API Key management in the target workspace. |
Query Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| search | string | Optional; matches by name and does not search fields or regex. Allows null: False Example: 验证码How to obtain or enter: Enter a keyword for the rule name; omit it if not needed. |
|
| pageIndex | integer | Default 1, minimum 1. Allows null: False $minValue: 1 Example: 1How to obtain or enter: Starts from 1; continue according to pageInfo. |
|
| pageSize | integer | Default 100, maximum 100. Allows null: False $minValue: 1 $maxValue: 100 Example: 20How to obtain or enter: Enter a value from 1 to 100. |
Request Example¶
curl --get 'https://openapi.guance.com/api/v1/data_mask_rule/list' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-urlencode pageIndex=1 \
--data-urlencode pageSize=20
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content.data | array<object> | Rules on this page, in descending order by id, including disabled rules; [] if there are no matches or the page is out of range. |
| content.declaration | object or null | Workspace common declaration attached to non-empty business objects; when not configured, it may be null or an empty object; empty objects are not added. The exact pagination position is subject to the structure of this page. |
| content.data[*].id | integer | Record number; not used for addressing. |
| content.data[*].uuid | string | wdmk_ rule UUID, used for details, modifications, and batch actions. |
| content.data[*].workspaceUUID | string | Workspace to which the rule belongs. |
| content.data[*].name | string | Rule name; the current endpoint does not check uniqueness of names. |
| content.data[*].type | string | Data category, which determines the applicable namespace. |
| content.data[*].field | string | Raw field configuration, comma-separated; consumers do not automatically trim leading/trailing spaces from each item. |
| content.data[*].reExpr | string | Saved regular expression, excluding custom replacement text. |
| content.data[*].roleUUIDs | array<string> | Applicable role UUIDs; [] does not mean all roles. |
| content.data[*].roleUUIDs[*] | string | A role UUID, which may be a system role identifier or a custom role_ UUID. |
| content.data[*].status | integer | 0 enabled, 2 disabled, 3 deleted; list/details exclude 3 and retain 2. |
| content.data[*].creator | string | Creator identity, which may be a Key UUID. |
| content.data[*].updator | string | Updater identity; empty string if not yet updated. |
| content.data[*].createAt | integer | Creation time in Unix seconds. |
| content.data[*].updateAt | integer | Update time in Unix seconds; may be -1 if not updated. |
| content.data[*].deleteAt | integer | Deletion time in Unix seconds; -1 if not deleted. |
| content.data[*].roles | array<object> | Supplementary role information for list/details; includes only roles that can be found within the visible scope, may include historical deleted/disabled states, and is not guaranteed to match the number of roleUUIDs. |
| content.data[*].roles[*].uuid | string | Role UUID. |
| content.data[*].roles[*].name | string or null | Role display name. |
| content.data[*].roles[*].status | integer or null | Current role status, subject to the actual record. |
| content.data[*].creatorInfo | object | Supplementary identity information for lists only; {} if not found; system identities may have fewer keys. |
| content.data[*].creatorInfo.uuid | string | Identity UUID; may be absent or empty, subject to the actual response. |
| content.data[*].creatorInfo.status | integer | Identity status; may be absent or empty, subject to the actual response. |
| content.data[*].creatorInfo.wsAccountStatus | integer | Workspace member status; may be absent or empty, subject to the actual response. |
| content.data[*].creatorInfo.username | string | Username/Key name; may be absent or empty, subject to the actual response. |
| content.data[*].creatorInfo.name | string | Name; may be absent or empty, subject to the actual response. |
| content.data[*].creatorInfo.email | string | Email or Key identifier; may be absent or empty, subject to the actual response. |
| content.data[*].creatorInfo.mobile | string | Mobile number; may be absent or empty, subject to the actual response. |
| content.data[*].creatorInfo.countryCode | string | Country code; may be absent or empty, subject to the actual response. |
| content.data[*].creatorInfo.iconUrl | string | Icon URL; may be absent or empty, subject to the actual response. |
| content.data[*].creatorInfo.acntWsNickname | string | Workspace nickname; may be absent or empty, subject to the actual response. |
| content.data[*].updatorInfo | object | Supplementary identity information for lists only; {} if not found; system identities may have fewer keys. |
| content.data[*].updatorInfo.uuid | string | Identity UUID; may be absent or empty, subject to the actual response. |
| content.data[*].updatorInfo.status | integer | Identity status; may be absent or empty, subject to the actual response. |
| content.data[*].updatorInfo.wsAccountStatus | integer | Workspace member status; may be absent or empty, subject to the actual response. |
| content.data[*].updatorInfo.username | string | Username/Key name; may be absent or empty, subject to the actual response. |
| content.data[*].updatorInfo.name | string | Name; may be absent or empty, subject to the actual response. |
| content.data[*].updatorInfo.email | string | Email or Key identifier; may be absent or empty, subject to the actual response. |
| content.data[*].updatorInfo.mobile | string | Mobile number; may be absent or empty, subject to the actual response. |
| content.data[*].updatorInfo.countryCode | string | Country code; may be absent or empty, subject to the actual response. |
| content.data[*].updatorInfo.iconUrl | string | Icon URL; may be absent or empty, subject to the actual response. |
| content.data[*].updatorInfo.acntWsNickname | string | Workspace nickname; may be absent or empty, subject to the actual response. |
| pageInfo.pageIndex | integer | Current page, starting from 1. |
| pageInfo.pageSize | integer | Number of entries per page. |
| pageInfo.count | integer | Number of entries on the current page. |
| pageInfo.totalCount | integer | Total count after filtering; the total count is still calculated by pagination for out-of-range pages. |
{
"code": 200,
"content": {
"data": [
{
"id": 10,
"uuid": "wdmk_example",
"workspaceUUID": "wksp_example",
"name": "验证码脱敏",
"type": "logging",
"field": "message",
"reExpr": "(?<=验证码=)[0-9]{6}",
"roleUUIDs": [
"role_example"
],
"status": 0,
"creator": "wsak_example",
"updator": "",
"createAt": 1785427200,
"updateAt": -1,
"deleteAt": -1,
"roles": [
{
"uuid": "role_example",
"name": "自定义只读角色",
"status": 0
}
],
"creatorInfo": {},
"updatorInfo": {}
}
],
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE",
"pageInfo": {
"pageIndex": 1,
"pageSize": 20,
"count": 1,
"totalCount": 1
}
}
Error Responses¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | Using an undeclared Query parameter or a parameter that violates the rules | Parameter parsing failed | Check the Query parameter table and example. |
| 500 | ft.InternalServerError | Rule reading, historical role data, or response formatting failed | Internal error | Retain the traceId, verify the configuration, and read again. |