All Products
Search
Document Center

Simple Message Queue (formerly MNS):ListEventRules

Last Updated:Dec 19, 2025

Queries a list of event notification rules.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

mns:ListEventRules

list

*Topic

acs:mns:{#regionId}:{#accountId}:/products/{#ProductName}/rules

None None

Request parameters

Parameter

Type

Required

Description

Example

ProductName

string

No

The name of the Alibaba Cloud service for which event notifications are configured.

oss

ResourceName

string

No

The resource name in the matching rule. This parameter is used to filter rules. For example, for Object Storage Service (OSS), this is the bucket name.

test-bucket

RuleName

string

No

The name of the rule.

rule-xsXDW

TopicName

string

No

The name of the topic.

test-topic

Subscription

object

No

The subscriber.

EndpointType

string

No

The endpoint type. Valid values:

  • topic: A topic can deliver messages to multiple subscribers. You can add or remove subscribers later.

  • queue: Messages are delivered directly to a queue. This simplifies the delivery path, but you cannot add new subscribers later.

topic

EndpointValue

string

No

The actual value of the endpoint.

test-topic

PageNum

integer

No

The page number of the results to return. Valid values: 1 to 100000. If you set this parameter to a value less than 1, the system uses 1. If you set this parameter to a value greater than 100000, the system uses 100000.

1

PageSize

integer

No

The number of entries to return on each page. Valid values: 10 to 50. If you set this parameter to a value less than 10, the system uses 10. If you set this parameter to a value greater than 50, the system uses 50.

20

NextToken

string

No

This parameter is deprecated. Use PageNum for paged queries.

cd7NlPlX4kgKCdsCWMiMR/+HnVzPLQ4/XLvjR64jZ7F9AQ+Mr3T59J6IVkuXeV3w

MaxResults

integer

No

This parameter is deprecated. Use PageSize for paged queries.

50

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

06273500-249F-5863-121D-74D51123E62C

Code

integer

The response code.

200

Status

string

The status of the response.

Success

Message

string

The response message.

operation success

Success

boolean

Indicates whether the request was successful.

true

Data

object

The response data.

PageNum

integer

The page number of the returned results.

1

PageSize

integer

The number of entries returned per page.

50

Size

integer

The number of entries on the current page.

20

Pages

integer

The total number of pages.

3

Total

integer

The total number of entries.

130

NextToken

string

This parameter is deprecated. Paged queries are based on PageNum.

a88f58d504b8b4c4e0b5e8707e68181f

MaxResults

integer

This parameter is deprecated. The maximum number of entries is based on Total.

1

PageData

array<object>

The data entries.

array<object>

The data entries.

RuleName

string

The name of the event notification rule.

rule-xsXDW

Subscriptions

array<object>

The subscribers. A maximum of 20 entries are returned. If there are more subscribers, see List Subscriptions.

object

EndpointType

string

The endpoint type.

queue

EndpointValue

string

The actual value of the endpoint.

wyx-vp-complete-queue

TopicName

string

The name of the topic.

demo-topic

MatchRules

array

The event matching rules. The rules have an OR relationship.

array

The event matching rules. The rules have an OR relationship.

EventMatchRule

The matching rules. Multiple rules have an OR relationship.

[[{\"MatchState\":true,\"Prefix\":\"cdhxdev1cdh-bba-dto-052901-sem-5seh/\",\"Suffix\":\"\"}]]

EventTypes

array

The list of event types.

string

The list of event types.

["oss:ObjectCreated:CopyObject"]

Endpoint

object

The endpoint of the subscription.

EndpointType

string

The endpoint type. Valid values:

  • topic: A topic can deliver messages to multiple subscribers. You can add or remove subscribers later.

  • queue: Messages are delivered directly to a queue. This simplifies the delivery path, but you cannot add new subscribers later.

topic

EndpointValue

string

The actual value of the endpoint.

test-topic

DeliveryMode

string

This parameter is deprecated.

--

Examples

Success response

JSON format

{
  "RequestId": "06273500-249F-5863-121D-74D51123E62C",
  "Code": 200,
  "Status": "Success",
  "Message": "operation success",
  "Success": true,
  "Data": {
    "PageNum": 1,
    "PageSize": 50,
    "Size": 20,
    "Pages": 3,
    "Total": 130,
    "NextToken": "a88f58d504b8b4c4e0b5e8707e68181f",
    "MaxResults": 1,
    "PageData": [
      {
        "RuleName": "rule-xsXDW",
        "Subscriptions": [
          {
            "EndpointType": "queue",
            "EndpointValue": "wyx-vp-complete-queue"
          }
        ],
        "TopicName": "demo-topic",
        "MatchRules": [
          [
            {
              "MatchState": true,
              "Name": "testBucket/folder1/file1",
              "Prefix": "testBucket/prefix1xxx",
              "Suffix": "suffix/xxxx.test"
            }
          ]
        ],
        "EventTypes": [
          "[\"oss:ObjectCreated:CopyObject\"]"
        ],
        "Endpoint": {
          "EndpointType": "topic",
          "EndpointValue": "test-topic"
        },
        "DeliveryMode": "--"
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.