All Products
Search
Document Center

DataWorks:EditRecognizeRule

Last Updated:Aug 28, 2026

Edits a sensitive field defined by the data category and sensitivity level in Data Security Guard.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:EditRecognizeRule

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

TenantId

string

Yes

The tenant ID. To obtain the tenant ID, log on to the DataWorks console, go to the DataStudio page of your workspace, click your username in the upper-right corner, and then click User Info.

10241024

AccountName

string

Yes

The Alibaba Cloud account used to create the sensitive data identification rule. Enter the username of the Alibaba Cloud account.

dsg-uat

SensitiveId

string

Yes

The sensitive field ID. You can call the QuerySensNodeInfo operation to query the IDs of all sensitive fields, or call the QueryRecognizeRuleDetail operation to query the IDs of specific sensitive fields.

1a928de7-3962-4e07-93ac-e1973baa1024

SensitiveName

string

Yes

The name of the custom sensitive field. The value must be less than 128 characters in length.

name

NodeId

string

Yes

The ID of the data category. You can call the QuerySensClassification operation to query the IDs of all data categories, and then specify the ID of the category under which to create the sensitive field.

0ce67949-0810-400f-a24a-cc5ffafe1024

NodeParent

string

Yes

The parent data category of the current data category. You can call the QuerySensClassification operation to obtain the ID of a data category.

Customer/personal/personal_Natural_Information/personal_basic_profile_information

TemplateId

string

Yes

The template ID. You can call the QueryDefaultTemplate operation to obtain the template ID.

e1970541-6cf5-4d23-b101-d5b66f6e1024

level

string

Yes

The sensitivity level of the sensitive field. Select a level from those defined in the template, such as level 1 to level 10.

1

LevelName

string

No

The name of the sensitivity level. You can call the QueryDefaultTemplate operation to obtain the name of the sensitivity level in the related template.

Confidential

SensitiveDescription

string

No

The description of the sensitive field. The value must be less than 128 characters in length.

This is a sensitive field that identifies the name.

Status

integer

No

The status of the sensitive field. Valid values:

  • 0: draft

  • 1: effective

0

OperationType

integer

Yes

The type of the logical operation. Valid values:

  • 0: OR

  • 1: AND

0

RecognizeRulesType

string

No

The type of the sensitive data identification rule. Valid values:

  • 1: regular expression

  • 2: built-in rule

  • 3: sample library

  • 4: self-generated data identification model

1

RecognizeRules

string

No

The content of the sensitive data identification rule. You can call the QuerySensNodeInfo operation to query the current parameter value for a built-in sensitive field.

{"contentRule":{"_clazz":"com.alipay.dsgclient.sdk.dsg.fastscan.engine.cond.GenderCond"},"_clazz":"com.alipay.dsg.dal.model.RuleContent"}

ContentScan

string

No

The content identification rule. You can call the QuerySensNodeInfo operation to query the current parameter value for a built-in sensitive field.

{"_clazz":"com.alipay.dsgclient.sdk.dsg.fastscan.engine.cond.NationalityCond"}

ColScan

string

No

The fields to scan. Only fields with assigned values are identified.

  • The value must be in the ${Project name}.${Table name}.${Field name} or ${Project name}.${Schema name}.${Table name}.${Field name} format.

  • *Wildcards are supported. For example, the asterisk (*) in default.table.column1* can be used to match any content following default.table.column1, such as default.table.column10.

default.qujian.*

ColExclude

string

No

The fields to exclude. Fields with assigned values are not identified.

  • The value must be in the ${Project name}.${Table name}.${Field name} or ${Project name}.${Schema name}.${Table name}.${Field name} format.

  • *Wildcards are supported. For example, the asterisk (*) in default.table.column1* can be used to match any content following default.table.column1, such as default.table.column10.

default.qujian.*6

CommentScan

string

No

The comment text to scan. Matches against each field comment in your data asset. Fuzzy match is supported.

test

HitThreshold

integer

No

The hit ratio threshold. If the percentage of sample data records that hit the Named Entity Recognition (NER) model exceeds this threshold (for example, 60%), the sensitive field is considered a match. Valid values: 0 to 100.

50

Response elements

Element

Type

Description

Example

object

The response parameters.

Success

boolean

Indicates whether the request was successful. Valid values:

  • true

  • false

true

ErrorCode

string

The error code.

9990030003

ErrorMessage

string

The error message.

Missing parameter

HttpStatusCode

integer

The HTTP status code.

200

Data

any

The returned result in JSON format.

{ "HttpStatusCode": 200, "Success": true }

RequestId

string

The request ID.

10000001

Examples

Success response

JSON format

{
  "Success": true,
  "ErrorCode": "9990030003",
  "ErrorMessage": "Missing parameter",
  "HttpStatusCode": 200,
  "Data": "{ \"HttpStatusCode\": 200, \"Success\": true }",
  "RequestId": "10000001"
}

Error codes

HTTP status code

Error code

Error message

Description

400 BADPARAMETERS Parameters are missing or in the wrong format.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.