Overview
Menu

CreateSmartEraseTemplate

Last updated: 2025-10-13 10:34:22Download PDF

1. API Description

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

This API is used to create a custom smart erasing template.

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 NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: CreateSmartEraseTemplate.
VersionYesStringCommon Params. The value used for this API: 2019-06-12.
RegionNoStringCommon Params. This parameter is not required for this API.
NameYesStringLength limit for the smart erasing template name: 64 characters.
EraseTypeYesStringErasing type.
-subtitle: subtitle removal.
-watermark: watermark removal.
-privacy: privacy protection.
CommentNoStringLength limit for the description information of the smart erasing template: 256 characters.
EraseSubtitleConfigNoSmartEraseSubtitleConfigSubtitle erasing configuration. This parameter is required and valid only when the value of EraseType is set to subtitle.
EraseWatermarkConfigNoSmartEraseWatermarkConfigWatermark erasing configuration. This parameter is required and valid only when the value of EraseType is set to watermark.
ErasePrivacyConfigNoSmartErasePrivacyConfigPrivacy protection configuration. This parameter is required and valid only when the value of EraseType is set to privacy.

3. Output Parameters

Parameter NameTypeDescription
DefinitionIntegerUnique identifier of the smart erasing template.
RequestIdStringThe 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 Subtitle Erasing Template with Extraction and Translation Features

This example shows you how to create a subtitle erasing template with extraction and translation features.

Input Example

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

{
    "Name": "Subtitle erasing template 2.",
    "EraseType": "subtitle",
    "EraseSubtitleConfig": {
        "SubtitleEraseMethod": "auto",
        "SubtitleModel": "standard",
        "OcrSwitch": "ON",
        "SubtitleLang": "zh_en",
        "SubtitleFormat": "vtt",
        "TransSwitch": "ON",
        "TransDstLang": "en"
    }
}

Output Example

{
    "Response": {
        "Definition": 200409,
        "RequestId": "ac14b422-1c7b-407d-9b95-530f1eea063d"
    }
}

Example2 Creating a Subtitle Erasing Template with Automatic and Area Erasing Capabilities

This example shows you how to create a subtitle erasing template that has the capability to detect and erase the text in the preset area while also allowing for direct erasure in the specified area during the specified time period.

Input Example

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

{
    "Name": "Subtitle erasing template 2.",
    "EraseType": "subtitle",
    "EraseSubtitleConfig": {
        "SubtitleEraseMethod": "auto",
        "SubtitleModel": "standard",
        "CustomAreas": [
            {
                "BeginMs": 200,
                "EndMs": 3000,
                "Areas": [
                    {
                        "LeftTopX": 0.05,
                        "LeftTopY": 0.1,
                        "RightBottomX": 0.75,
                        "RightBottomY": 0.9,
                        "Unit": 1
                    }
                ]
            }
        ]
    }
}

Output Example

{
    "Response": {
        "Definition": 200410,
        "RequestId": "835f2ecd-8666-4717-998b-02680437a8ef"
    }
}

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 CodeDescription
InvalidParameterValue.AutoAreasThe configuration for the automatic erasing area of the erasing template is incorrect.
InvalidParameterValue.CommentParameter error: template description.
InvalidParameterValue.CustomAreasThe specified area of the erasing template is incorrect.
InvalidParameterValue.ErasePrivacyConfigThe privacy protection configuration of the erasing template is incorrect.
InvalidParameterValue.EraseSubtitleConfigThe subtitle erasing configuration of the erasing template is incorrect.
InvalidParameterValue.EraseTypeThe erasing type of the erasing template is incorrect.
InvalidParameterValue.EraseWatermarkConfigThe watermark erasing configuration of the erasing template is incorrect.
InvalidParameterValue.NameIncorrect parameter value: Name exceeds the length limit.
InvalidParameterValue.PrivacyModelThe privacy protection model of the erasing template is incorrect.
InvalidParameterValue.PrivacyTargetsThe privacy protection target of the erasing template is incorrect.
InvalidParameterValue.SubtitleEraseMethodThe subtitle erasing method of the erasing template is incorrect.
InvalidParameterValue.SubtitleLangThe language for the subtitle erasing of the erasing template is incorrect.
InvalidParameterValue.SubtitleModelThe subtitle erasing model of the erasing template is incorrect.
InvalidParameterValue.SwitchIncorrect parameter value: invalid Switch value.
InvalidParameterValue.TransDstLangThe configuration for the translation target language is incorrect under the smart erasing - subtitle erasing template.
InvalidParameterValue.WatermarkEraseMethodThe watermark erasing method of the erasing template is incorrect.
InvalidParameterValue.WatermarkModelThe watermark erasing model of the erasing template is incorrect.