tencent cloud

APIs

ModifyTopic

Download
Focus Mode
Font Size
Last updated: 2026-06-10 15:00:20

1. API Description

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

This API is used to modify logs or metric topics.

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: ModifyTopic.
Version Yes String Common Params. The value used for this API: 2020-10-16.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
TopicId Yes String

Topic ID - Obtain the topic Id through Get Topic List.

TopicName No String

Topic name
Input restrictions:

  • Cannot be an empty string
  • Cannot contain character '
Tags.N No Array of Tag

List of tag descriptions. By specifying this parameter, you can bind tags to the appropriate topic simultaneously. Supports up to 10 tag key-value pairs, and no duplicate key-value pairs are allowed.

Status No Boolean

Whether the topic has log collection enabled. true: start collection; false: disable collection.
The console currently does not support modification of this parameter.

AutoSplit No Boolean

Whether to enable auto-split

MaxSplitPartitions No Integer

If maximum split is enabled, the maximum number of partitions allowed for this topic;
default is 50; must be a positive number

Period No Integer

Lifecycle in days. Standard storage value range is 1-3600. Infrequent storage value range is 7-3600. A value of 3640 indicates permanent retention.

StorageType No String

Storage type: cold infrequent storage, hot standard storage

Describes No String

Topic description

HotPeriod No Integer

0: The log topic disables log settlement.
Non-0: Number of days for standard storage after log settlement is enabled for the log topic. HotPeriod needs to be greater than or equal to 7 and less than Period.
Effective only when StorageType is hot. This configuration is not supported for metric topics.

IsWebTracking No Boolean

Free authentication switch. false: disabled; true: enabled.
Once enabled, anonymous access to the log topic will be supported for specified operations. For details, please see log topic.

Extends No TopicExtendInfo

Topic extended information

PartitionCount No Integer

Number of topic partitions.
Defaults to 1.
Value ranges and constraints:

  • When the input value <=0, the system automatically adjusts it to 1.
  • If MaxSplitPartitions is not passed, PartitionCount must be <=50.
  • If MaxSplitPartitions is passed, PartitionCount must be <=MaxSplitPartitions.
CancelTopicAsyncTaskID No String

id of the cancel switch storage task

  • Obtain the id of the cancel switch storage task [TopicAsyncTaskID field in Topics] by get log topic list.
Encryption No Integer

Encryption-related parameters. Encrypted regions are supported and can be passed for allowlisted users. Cannot be passed in other scenarios.
Only support passing in 1: kms-cls secret key for cloud product encryption.

IsSourceFrom No Boolean

Enable logging of public network source IP and server receipt time

BillingMode No Integer

Billing mode

Enumeration value:

  • 0: Function billing by usage
  • 1: Raw log size billing (currently only supports some customers)

Default value: 0

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 Modify Log Topic

Modify Log Topic

Input Example

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

{
    "TopicId": "866f8a15-ae8e-4ab4-afb2-4ff169fa3dc0",
    "TopicName": "testname",
    "Period": 10
}

Output Example

{
    "Response": {
        "RequestId": "6ef60bec-0242-43af-bb20-270359fb54a7"
    }
}

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
FailedOperation Operation failed.
FailedOperation.InvalidPeriod The offline storage period cannot be less than 7 days.
FailedOperation.TagQpsLimit The frequency of tag service requests is limited.
FailedOperation.TopicClosed The log topic has been disabled.
FailedOperation.TopicIsolated The log topic has been isolated.
InternalError Internal error.
InvalidParameter Incorrect parameter.
InvalidParameter.TopicConflict There is already a log topic with the same name in the specified logset.
LimitExceeded The quota limit has been reached.
OperationDenied Operation denied.
OperationDenied.ACLFailed ACL verification failed.
OperationDenied.AccountDestroy The account has been terminated.
OperationDenied.AccountIsolate The account has overdue payments.
OperationDenied.AccountNotExists The account does not exist.
OperationDenied.TopicHasScheduleSqlTask The topic is bound to the scheduleSql job.
ResourceNotFound The resource does not exist.
ResourceNotFound.TopicNotExist The log topic does not exist.

Help and Support

Was this page helpful?

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

Feedback