Configures the read/write mode for a specified topic.


This operation can be called to forbid read or write operations on a specific topic.

QPS limit

Each Alibaba Cloud account can call this operation up to 10 times per second. If the number of requests that you send to call this operation within a second exceeds the queries per second (QPS) limit, throttling is triggered. This may interrupt your business. For information about the QPS limit of each operation, see API rate limits.


By default, Alibaba Cloud accounts can call this operation. A Resource Access Management (RAM) user can call this operation only after the RAM user is granted the required permissions. The following table describes the permissions that must be granted to a RAM user to call this operation. For information about how to grant permissions, see Policies.



Resource in an instance with a namespace

Resource in an instance without a namespace






Request parameters

Parameter Type Required Example Description
Action String Yes OnsTopicUpdate

The operation that you want to perform. Set the value to OnsTopicUpdate.

Topic String Yes test

The name of the topic that you want to manage.

Perm Integer Yes 6

The read/write mode that you want to configure for the topic. Valid values:

  • 6: Both read and write operations are allowed.
  • 4: Write operations are forbidden.
  • 2: Read operations are forbidden.
InstanceId String Yes MQ_INST_111111111111_DOxxxxxx

The ID of the instance to which the topic belongs.

Response parameters

Parameter Type Example Description
RequestId String 81979ADA-4A78-4F64-9DEC-5700446D****

The ID of the request. The system generates a unique ID for each request. You can troubleshoot issues based on the request ID.


Sample requests

&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK


JSON format

HTTP/1.1 200 OK

  "RequestId" : "81979ADA-4A78-4F64-9DEC-5700446D****"

Error codes

For a list of error codes, visit the API Error Center.