EdgeOne Logo


1. API Description

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

This API is used to modify a rule in the rule engine.

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: ModifyRule.
VersionYesStringCommon Params. The value used for this API: 2022-09-01.
RegionNoStringCommon Params. This parameter is not required.
ZoneIdYesStringID of the site
RuleNameYesStringThe rule name. It is a string that can contain 1–255 characters.
Rules.NYesArray of RuleThe rule content.
RuleIdYesStringThe rule ID.
StatusYesStringRule status. Values:
  • enable: Enabled
  • disable: Disabled
  • Tags.NNoArray of StringTag of the rule.

    3. Output Parameters

    Parameter NameTypeDescription
    RuleIdStringRule ID
    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 ModifyRule

    The following example shows common modifications.

    Input Example

    POST / HTTP/1.1
    Host: teo.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ModifyRule
    <Common request parameters>
        "Status": "disable",
        "Rules": [
                "Actions": [
                        "NormalAction": {
                            "Action": "RangeOriginPull",
                            "Parameters": [
                                    "Name": "Switch",
                                    "Values": [
                        "CodeAction": {
                            "Action": "StatusCodeCache",
                            "Parameters": [
                                    "Name": "CacheTime",
                                    "StatusCode": 200,
                                    "Values": [
                        "RewriteAction": {
                            "Action": "ResponseHeader",
                            "Parameters": [
                                    "Action": "set",
                                    "Name": "Foo",
                                    "Values": [
                                    "Action": "add",
                                    "Name": "Hello",
                                    "Values": [
                                    "Action": "del",
                                    "Name": "Foo2",
                                    "Values": [
                "Conditions": [
                        "Conditions": [
                                "Operator": "equal",
                                "Target": "host",
                                "Values": [
        "RuleName": "new_rule02",
        "ZoneId": "zone-26r78x31ny86",
        "RuleId": "rule-djuqmq"

    Output Example

        "Response": {
            "RequestId": "811d2583-310c-41f4-b5e7-abe4074047d4",
            "RuleId": "rule-djuqmq"

    5. Developer Resources


    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
    InternalError.ConfigLockedThe configuration is locked. Please unlock and try again.
    InternalError.SystemErrorInternal system error.
    InvalidParameter.CacheKeyQueryStringTooManyValueThe query string has too many values.
    InvalidParameter.CertSystemErrorInternal error.
    InvalidParameter.CompressionInvalidAlgorithmsInvalid compression algorithm.
    InvalidParameter.ErrActionUnsupportTargetThe current conditions do not support the requested operation.
    InvalidParameter.ErrInvalidActionInvalid operation.
    InvalidParameter.ErrInvalidActionDuplicateActionInvalid operation: Duplicate operation configuration.
    InvalidParameter.ErrInvalidActionParamInvalid operation: Invalid parameter.
    InvalidParameter.ErrInvalidActionParamActionInvalid parameter "action".
    InvalidParameter.ErrInvalidActionParamDuplicateNameInvalid parameter: Duplicate parameter names.
    InvalidParameter.ErrInvalidActionParamNameInvalid value type for the parameter "action".
    InvalidParameter.ErrInvalidActionParamTooManyValuesInvalid parameter: The parameter has too many values.
    InvalidParameter.ErrInvalidActionParamValueInvalid action.
    InvalidParameter.ErrInvalidActionTypeInvalid action type.
    InvalidParameter.ErrInvalidConditionHostTooManyWhenModifyOriginActionConfiguredYou can only configure one host matching type when modifying the origin.
    InvalidParameter.ErrInvalidConditionIgnoreCaseInvalid condition: The letter case is ignored.
    InvalidParameter.ErrInvalidConditionNameBadNameInvalid condition: Invalid parameter name.
    InvalidParameter.ErrInvalidConditionNameTargetNotSupportNameInvalid condition: The match type is not supported by this parameter.
    InvalidParameter.ErrInvalidConditionValueBadRegularInvalid condition: Invalid regular expression for the parameter value.
    InvalidParameter.ErrInvalidConditionValueBadUrlInvalid parameter value "url".
    InvalidParameter.ErrInvalidConditionValueBadValueInvalid condition: The parameter value is invalid.
    InvalidParameter.ErrInvalidConditionValueBadValueContainFileNameExtensionInvalid parameter value: File extension is not allowed.
    InvalidParameter.ErrInvalidConditionValueTooLongValueInvalid condition: The parameter value exceeds the limit.
    InvalidParameter.ErrInvalidConditionValueTooManyValuesInvalid condition: The parameter value exceeds the limit.
    InvalidParameter.ErrInvalidConditionValueTooManyWildcardInvalid condition: Too many wildcards in the parameter.
    InvalidParameter.ErrInvalidElseWhenModifyOriginActionConfiguredELSE is not supported for origin server modification.
    InvalidParameter.ErrNilConditionEmpty condition.
    InvalidParameter.GrpcRequireHttp2To enable gRPC support, HTTP/2 support must be enabled as well.
    InvalidParameter.HostNotFoundThe domain name does not exist.
    InvalidParameter.InvalidAuthenticationTypeSecretKeyInvalid key for token authentication.
    InvalidParameter.InvalidAuthenticationTypeSignParamInvalid token authentication parameter.
    InvalidParameter.InvalidAuthenticationTypeTimeFormatInvalid authentication token format.
    InvalidParameter.InvalidAuthenticationTypeTimeParamInvalid authentication token parameter.
    InvalidParameter.InvalidAwsRegionInvalid region. Please fill in a correct region of the third-party object storage service.
    InvalidParameter.InvalidBackupServerNameInvalid secondary origin domain.
    InvalidParameter.InvalidCacheKeyInvalid cache key.
    InvalidParameter.InvalidCacheKeyCookieInvalid cache key cookie.
    InvalidParameter.InvalidCacheKeyIgnoreCaseCases are ignored in the cache key.
    InvalidParameter.InvalidCacheKeySchemeInvalid cache key scheme.
    InvalidParameter.InvalidCacheTimeInvalid node cache validity.
    InvalidParameter.InvalidClientIpHeaderNameInvalid client IP request header.
    InvalidParameter.InvalidCosDomainInvalid origin-pull configuration. When OriginType is COS or AWS_S3, the origin address must be an object storage domain name.
    InvalidParameter.InvalidErrorPageRedirectUrlInvalid custom error page.
    InvalidParameter.InvalidHttpsCipherSuiteAndTlsVersionThe cipher suite does not match the TLS version.
    InvalidParameter.InvalidHttpsHstsMaxAgeInvalid HTTPS HSTS.
    InvalidParameter.InvalidIpv6SwitchInvalid IPv6 settings.
    InvalidParameter.InvalidMaxAgeTimeInvalid browser cache.
    InvalidParameter.InvalidOriginInvalid origin server.
    InvalidParameter.InvalidParameterInvalid parameter.
    InvalidParameter.InvalidRangeOriginPullInvalid Range GETs.
    InvalidParameter.InvalidRequestHeaderNameInvalid request header.
    InvalidParameter.InvalidRequestHeaderNameXffInvalid request header x-forwarded-for.
    InvalidParameter.InvalidRequestHeaderValueInvalid request header.
    InvalidParameter.InvalidResponseHeaderNameInvalid response header.
    InvalidParameter.InvalidResponseHeaderValueInvalid response header.
    InvalidParameter.InvalidRuleEngineActionInvalid rule engine operation.
    InvalidParameter.InvalidRuleEngineNotFoundThe rule does not exist.
    InvalidParameter.InvalidRuleEngineTargetInvalid rule engine condition.
    InvalidParameter.InvalidRuleEngineTargetsExtensionInvalid file extension in the rule engine condition.
    InvalidParameter.InvalidRuleEngineTargetsUrlInvalid URL in the rule engine condition.
    InvalidParameter.InvalidServerNameInvalid origin domain.
    InvalidParameter.InvalidUpstreamRequestQueryStringValueOrigin-pull request configuration error: Invalid query string.
    InvalidParameter.InvalidUrlRedirectHostInvalid target host in the URL rewriting rule.
    InvalidParameter.InvalidUrlRedirectUrlThe target URL for URL rewrite is invalid.
    InvalidParameter.KeyRulesInvalidQueryStringValueInvalid cache key.
    InvalidParameter.LoadBalanceInstanceIdIsRequiredThe Cloud Load Balancer instance ID is required in the operation of modifying the origin server.
    InvalidParameter.NotSupportThisPresetUnsupported preset variables exist.
    InvalidParameter.OriginOriginGroupIdIsRequiredThe origin group ID is required.
    InvalidParameter.OriginPullProtocolIsRequiredThe return protocol is required in the operation of modifying the origin server.
    InvalidParameter.PostMaxSizeLimitExceededMaximum upload size exceeded.
    InvalidParameter.ResponseHeaderCacheControlNotAllowDeleteInvalid response header.
    InvalidParameter.StatusCodeCacheInvalidStatusCodeInvalid status code in cache.
    InvalidParameter.TlsVersionNotInSequenceTLS version is not continuous for HTTPS.
    LimitExceededThe quota limit has been reached.
    OperationDeniedOperation denied.
    OperationDenied.ConfigLockedThe configuration is locked. Please unlock and try again.
    OperationDenied.ErrZoneIsAlreadyPausedThe EdgeOne service of the site is disabled. Please enable it and try again.
    OperationDenied.InvalidAdvancedDefenseSecurityTypeThe security service must be enabled when you enable the DDoS Protection.
    ResourceInUseThe resource is occupied.
    UnauthorizedOperation.CamUnauthorizedCAM is not authorized.
    UnauthorizedOperation.UnknownAn unknown error occurred in the backend server.