tencent cloud

APIs

CreateDspmRiskStrategy

Download
Focus Mode
Font Size
Last updated: 2026-09-01 10:19:22

1. API Description

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

This API is used to create a Dspm custom risk policy.

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: CreateDspmRiskStrategy.
Version Yes String Common Params. The value used for this API: 2022-11-21.
Region No String Common Params. This parameter is not required.
Name Yes String

Policy name.

Rule Yes String

Policy rule, JSON string

MemberId.N No Array of String

Group account member id

EnName No String

English policy name.

Description No String

Policy description.

EnDescription No String

English strategy description

RiskLevel No String

Risk level. Available values: Info/Low/Medium/High. Default if not passed: Medium

IsEnabled No Integer

Whether to enable. 0: disable, 1: enable. If not specified, enabled by default.

RiskType No String

Risk type. Currently only support alarm, default if not passed: alarm

StrategyCategory No String

Policy category. Currently only support SQLOperationAnomaly. If not passed, SQLOperationAnomaly is used by default

3. Output Parameters

Parameter Name Type Description
StrategyId Integer

Policy ID.

StrategyType String

Policy type.

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 Creating a Dspm custom risk policy

Input Example

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

{
"Name": "Custom SQL injection audit rule"
    "Rule": "{\"RuleType\":1,\"Fields\":[{\"Key\":\"SqlText\",\"Operator\":\"contains\",\"Value\":\"sleep(\"}],\"RuleIdentifier\":\"CustomSqlInjection\",\"SaveToDb\":true}",
    "RiskLevel": "High",
    "IsEnabled": "1",
    "RiskType": "alarm",
    "StrategyCategory": "SQLOperationAnomaly"
}

Output Example

{
    "Response": {
        "StrategyId": "190001",
        "StrategyType": "CustomAudit_8f6b5b0c2c1b4bb7a1e4bcb828c97a6a",
        "RequestId": "cf839eee-b651-4ff3-9b49-173f9f55733f"
    }
}

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

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
AuthFailure CAM signature/authentication error.
FailedOperation Operation failed.
OperationDenied Operation denied.
ResourceNotFound The resource does not exist.
ResourceUnavailable Resources are unavailable.

Help and Support

Was this page helpful?

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

Feedback