tencent cloud

APIs

CreateSandboxDLPRule

Download
Focus Mode
Font Size
Last updated: 2026-09-01 10:12:05

1. API Description

Domain name for API request: csip.intl.tencentcloudapi.com.

Create a DLP user rule. You can reference several system rules (SystemRuleIDList) or define a custom rule (UserRuleContent, name + regular). At least one of both is required. UserRuleInfo is a newly-added optional structured input parameter. When it is passed together with UserRuleContent, UserRuleInfo takes precedence.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateSandboxDLPRule.
Version Yes String Common Params. The value used for this API: 2022-11-21.
Region No String Common Params. This parameter is not required.
RuleName Yes String

Rule name
Input parameter limit: length 1-128

Level Yes String

Rule level
Enumeration values:
INFO: notification
LOW: low risk
MEDIUM: medium risk
HIGH: high risk
CRITICAL: critical

RuleAction Yes String

Rule action
Enumeration value:
PASS: allowlist
BLOCK: block and alarm
MONITOR: alarm

BelongAssetType Yes String

Affiliated asset type
Enumeration values:
HOST: Host
CONTAINER: Container

EffectScope Yes TrafficSandboxEffectScope

Effective scope

Status Yes String

Initial status
Enumeration values:
ON: Enable
OFF: Disable

SystemRuleIDList.N No Array of Integer

Referenced system rule ID list
Input limit: up to 1000; at least one of this or UserRuleContent must be provided

UserRuleContent.N No Array of TrafficSandboxDLPRuleContentItem

User-defined rule content
Input limits: up to 100 sub-rules; import either this or UserRuleInfo. If both are imported at the same time, UserRuleInfo takes precedence

UserRuleInfo No TrafficSandboxDLPUserRuleInfo

Newly-added selectable structured input parameters support 5 detection dimensions (file name/file size/file format/outbound domain name/outbound content). Each dimension is selectable and at least one must be hit. It will override when passed at the same time as UserRuleContent.

3. Output Parameters

Parameter Name Type Description
ID Integer

ID of the created rule

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Sample code for creating a DLP policy

Input Example

POST / HTTP/1.1
Host: csip.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateSandboxDLPRule
<Common request parameters>

{
    "RuleName": "Border exit sensitive data protection",
    "Level": "HIGH",
    "BelongAssetType": "CONTAINER",
    "UserRuleContent": [
        {
            "RuleName": "Identity card number",
            "RuleContent": "[1-9]\\d{5}(19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[0-9Xx]"
        }
    ],
    "EffectScope": {
        "EffectType": "EXCLUDE"
    },
    "RuleAction": "BLOCK",
    "Status": "ON"
}

Output Example

{
    "Response": {
        "ID": 4001,
        "RequestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback