tencent cloud

Tencent Cloud EdgeOne

BindSecurityTemplateToEntity

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-11-25 16:58:22

1. API Description

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

Operate a security policy template. This API is used to bind or rebind a domain name to a designated policy template, or unbind it from a designated policy 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 Name Required Type Description
Action Yes String Common Params. The value used for this API: BindSecurityTemplateToEntity.
Version Yes String Common Params. The value used for this API: 2022-09-01.
Region No String Common Params. This parameter is not required.
ZoneId Yes String Site ID of the policy template to be bound or unbound.
Entities.N Yes Array of String Domain name list bound to the policy template (or unbound from it).
Operate Yes String Bind or unbind operation options. Valid values:
  • bind: Bind a domain name to the policy template.
  • unbind-keep-policy: Unbind the domain name from the policy template while retaining the current policy.
  • unbind-use-default: Unbind the domain name from the policy template and use the default blank policy.
  • Note: The unbinding operation currently only supports unbinding a single domain name. That is, when the Operate parameter value is unbind-keep-policy or unbind-use-default, the Entities parameter list supports filling in only one domain name.
    TemplateId Yes String Specifies the ID of the policy template or the site global policy to be bound or unbound.
  • To bind to a policy template, or unbind from it, specify the policy template ID.
  • To bind to the site's global policy, or unbind from it, use the @ZoneLevel@domain parameter value.


  • Note: After unbinding, the domain name will use an independent policy and rule quota will be calculated separately. Please make sure there is sufficient rule quota before unbinding.
    OverWrite No Boolean If the imported domain name is already bound to a policy template (including a site-level protection strategy), setting this parameter indicates whether to replace the template. Default value: true. Valid values:
  • true: Replace the template currently bound to the domain name.
  • false: Do not replace the template currently bound to the domain name.
  • Note: When set to false, if the imported domain name is already bound to a policy template, an error will be returned. A site-level protection strategy is also a type of policy template.

    3. Output Parameters

    Parameter Name Type Description
    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 Unbind a specified domain name from a policy template

    This method unbinds a specified domain name that has been bound to a policy template from the policy template. Currently, it only supports unbinding one domain name at a time. When unbinding, the following options are supported:

    1. If the rule quota allows, the current policy is retained. When unbinding, a standalone security policy is generated for the domain name. This policy uses the same configuration as the current policy Template, and the rules in it will use additional rule quota.
    2. Use a blank security policy. Use the default blank policy. Preset rules will use the default configuration, and custom rule content will no longer take effect.

    Example: To unbind a.test.com from an existing policy template (policy template ID: temp-cuwg1hki, associated site ID: zone-2aq0e8rhu6jx), see the following example to proceed with unbinding.

    Note: If you choose to retain the current policy configuration, please ensure the current site has sufficient security rule quota. If the remaining quota is insufficient to support retaining the current policy, unbinding will fail and the domain will remain bound to the current policy template.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: OperateSecurityTemplate
    <Common request parameters>
    
    {
        "ZoneId": "zone-2aq0e8rhu6jx",
        "Entities": [
            "a.test.com"
        ],
        "TemplateId": "temp-cuwg1hki",
        "Operate": "unbind-keep-policy"
    }

    Output Example

    {
        "Response": {
            "RequestId": "09ce3d28-1119-49cd-xxxx-27cb34dac669"
        }
    }

    Example2 Apply a policy template to a specified domain name (bind a domain name to a policy template)

    This method applies an existing policy template to a specified domain name. It supports simultaneous binding to domain names of multiple sites.

    For example, to bind the domain names a.test.com and b.example.com to an existing policy template (template ID: temp-cuwg1hki, associated site ID: zone-2aq0e8rhu6jx), see the following example.

    Note: Your account must have operation permissions for all sites that the specified domain name list belongs to.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: OperateSecurityTemplate
    <Common request parameters>
    
    {
        "ZoneId": "zone-2aq0e8rhu6jx",
        "Entities": [
            "a.test.com",
            "b.example.com"
        ],
        "TemplateId": "temp-cuwg1hki",
        "Operate": "bind",
        "OverWrite": true
    }

    Output Example

    {
        "Response": {
            "RequestId": "09ce3d28-1119-49cd-xxxx-27cb34dac669"
        }
    }

    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
    InternalError.ConfigLocked The configuration has been locked. Unlock it and retry.
    InternalError.ProxyServer Unknown error occurs on the real server.
    InvalidParameter.Security Parameter error.
    OperationDenied Operation denied.
    ResourceInUse The resource is occupied.
    UnauthorizedOperation.CamUnauthorized Unauthorized Cam operation.
    UnsupportedOperation The operation is not supported.

    ヘルプとサポート

    この記事はお役に立ちましたか?

    フィードバック