tencent cloud

ModifyTopic
Last updated: 2025-11-25 10:53:33
ModifyTopic
Last updated: 2025-11-25 10:53:33

1. API Description

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

This API is used to modify the topic remarks and number of partitions.

A maximum of 50 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-02-17.
Region Yes String Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-bangkok, ap-beijing, ap-chengdu, ap-chongqing, ap-guangzhou, ap-hongkong, ap-jakarta, ap-nanjing, ap-seoul, ap-shanghai, ap-shanghai-fsi, ap-shenzhen-fsi, ap-singapore, ap-tokyo, eu-frankfurt, na-ashburn, na-siliconvalley.
EnvironmentId Yes String Environment (namespace) name.
TopicName Yes String Topic name.
Partitions Yes Integer Specifies the number of partitions, which must be greater than or equal to the original partition count. if you want to maintain the original number of partitions, please enter the original number. changing the number of partitions is only effective for non-global sequential messages and cannot exceed 32 partitions.
ClusterId Yes String Pulsar cluster ID
Remark No String Remarks (up to 128 characters).
MsgTTL No Integer Unconsumed message expiration time. measurement unit: seconds. value range: 60 seconds to 15 days.
UnackPolicy No String Default if not passed is native policy. DefaultPolicy means when the subscription reaches the maximum unacknowledged messages of 5000, the server will stop pushing messages to all consumers under the current subscription. DynamicPolicy refers to dynamically adjusting the maximum unacknowledged messages under the subscription, with the specific quota being the maximum between 5000 and the number of consumers multiplied by 20. the default maximum unacknowledged message count per consumer is 20. exceeding this limit only affects that consumer and does not affect other consumers.
IsolateConsumerEnable No Boolean Whether exception consumer isolation is enabled.
AckTimeOut No Integer Consumer Ack timeout period in seconds. value range: 60-(3600*24).

3. Output Parameters

Parameter Name Type Description
Partitions Integer Number of partitions
Remark String Remarks (up to 128 characters).
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 topic attributes.

Input Example

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

{
    "EnvironmentId": "devNs",
    "TopicName": "devTopic",
    "Partitions": 1,
    "Remark": "devTest",
    "ClusterId": "pulsar-5r59xd4vnx",
    "MsgTTL": 1
}

Output Example

{
    "Response": {
        "Partitions": 3,
"Remark": "Change partition to 3"
        "RequestId": "c276a96f-1612-47ad-9562-da06d4fdf1ed"
    }
}

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.UnauthorizedOperation CAM authentication failed.
FailedOperation Operation failed.
FailedOperation.CloudService Third-Party cloud service exception. try again later.
FailedOperation.GetTopicPartitionsFailed Failed to get the number of topic partitions.
FailedOperation.OperateLater Task in progress. please try again later.
FailedOperation.UpdateTopic Failed to update the topic.
InternalError.SystemError System error.
InvalidParameterValue.InvalidParams The parameter value is out of the value range.
MissingParameter.NeedMoreParams A required parameter is missing.
ResourceNotFound.Cluster The cluster does not exist.
ResourceNotFound.Topic The topic does not exist.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback