Updated on 2026-09-15 GMT+08:00

CLI Command Reference

Subscribers

API Name

Command

Description

Operation

Adding a Subscriber

hcloud SMNGLOBAL CreateSubscriptionUser

This API is used to add a subscriber. If the subscriber is in the Unconfirmed status, the system sends a subscription confirmation message to the subscriber. After the subscriber clicks the subscription confirmation link, the subscriber status changes to Confirmed and a subscription cancellation message is sent to the subscriber so that the subscriber can cancel the subscription at any time. After the subscriber clicks the link to cancel the subscription, the subscriber status changes to Cancelled and a new subscription confirmation message is sent to the subscriber so that the subscriber can subscribe again.

Debug

Querying Subscribers

hcloud SMNGLOBAL ListSubscriptionUser

This API is used to query subscribers.

Debug

Deleting a Subscriber

hcloud SMNGLOBAL DeleteSubscriptionUser

This API is used to delete a subscriber.

Debug

Updating a Subscriber

hcloud SMNGLOBAL UpdateSubscriptionUser

This API is used to update a subscriber.

Debug

Topics

API Name

Command

Description

Operation

Querying Topics

hcloud SMN ListTopics

This API is used to query topics by page. The topics are sorted by creation time in descending order. You can specify offset and limit. If no topic has been created, an empty list is returned.

Debug

Creating a Topic

hcloud SMN CreateTopic

This API is used to create a topic. Each user can create a maximum of 3,000 topics. In high-concurrency scenarios, more than 3,000 topics may be created. This is acceptable.

Debug

Querying Details About a Topic

hcloud SMN ListTopicDetails

This API is used to query details about a topic.

Debug

Updating a Topic

hcloud SMN UpdateTopic

This API is used to update the topic display name.

Debug

Deleting a Topic

hcloud SMN DeleteTopic

This API is used to delete a topic.

Debug

Querying a Topic Policy

hcloud SMN ListTopicAttributes

This API is used to query a topic policy.

Debug

Deleting All Topic Policies

hcloud SMN DeleteTopicAttributes

This API is used to delete all topic policies.

Debug

Updating a Topic Policy

hcloud SMN UpdateTopicAttribute

This API is used to update a topic policy.

Debug

Deleting a Specified Topic Policy

hcloud SMN DeleteTopicAttributeByName

This API is used to delete a topic policy with a specified name.

Debug

Querying Sending Details of a Topic

hcloud SMN ListTopicMessageStatistics

This API is used to query the data sent by a topic. You can query all statistical data of the last 31 days.

Debug

Querying the Topic List Along with Their Associated Resources

hcloud SMN ListTopicsWithAssociatedResources

This API is used to query the topic list along with their associated resources. The associated resources will grow as the service expands. By default, topics are sorted by creation time in descending order. You can specify offset and limit for pagination query. If no topic has been created, an empty list is returned.

Debug

Subscriptions

API Name

Command

Description

Operation

Batch Deleting Subscriptions

hcloud SMN BatchDeleteSubscriptions

This API is used to delete subscriptions in a batch. The deletion result of each subscription endpoint is displayed in the response body.

Debug

Querying Subscriptions

hcloud SMN ListSubscriptions

This API is used to query all subscriptions of a requestor by page. The subscriptions are sorted by creation time in ascending order. You can specify offset and limit. If there are no subscriptions, an empty list is returned.

Debug

Batch Deleting Subscriptions from a Specified Topic

hcloud SMN BatchDeleteSubscriptionsByTopic

This API is used to batch delete subscriptions from a specified topic. The deletion result of each subscription endpoint is displayed in the response body.

Debug

Querying Subscriptions of a Specified Topic

hcloud SMN ListSubscriptionsByTopic

This API is used to query subscriptions of a specified topic by page. The subscriptions are sorted by creation time in ascending order. You can specify offset and limit. If the topic has no subscriptions, an empty list is returned.

Debug

Adding a Subscription

hcloud SMN AddSubscription

This API is used to add a subscription to a specified topic. If the status of the subscriber is unconfirmed, a confirmation message is sent to the subscriber. After confirming the subscription, the subscriber can receive notification messages published to the topic. By default, 10,000 subscriptions can be added to a topic. However, in a high-concurrency scenario, extra subscriptions may be added successfully. This is acceptable. The API is idempotent. If the added subscription already exists, a successful result and status code 200 are returned. Otherwise, the status code is 201.

Debug

Deleting a Subscription

hcloud SMN CancelSubscription

This API is used to delete a specified subscription.

Debug

Deleting a Subscription from a Specified Topic

hcloud SMN DeleteSubscriptionsByTopic

This API is used to delete a subscription from a specified topic.

Debug

Updating a Subscription

hcloud SMN UpdateSubscription

This API is used to update the remarks of a subscription.

Debug

Importing a Subscription

hcloud SMN AddSubscriptionFromSubscriptionUser

This API is used to add a subscription to a specified topic. The subscription information comes from the subscriber list.

Debug

Confirming a Subscription

hcloud SMN ConfirmSubscription

This API is used to confirm the message of subscription to a topic.

Debug

Canceling a Subscription

hcloud SMN UnsubscribeSubscription

This API is used to cancel a subscription.

Debug

Subscribing to a Topic

hcloud SMN SubscribeTopic

This API is used to confirm the subscription to a topic.

Debug

Unsubscribing from a Topic

hcloud SMN UnsubscribeTopic

This API is used to unsubscribe from a topic.

Debug

Templates

API Name

Command

Description

Operation

Querying Message Templates

hcloud SMN ListMessageTemplates

This API is used to query message templates by page. The templates are sorted by creation time in ascending order. You can specify offset and limit. If no template has been created, an empty list is returned. The additional query parameters are message_template_name and protocol.

Debug

Creating a Message Template

hcloud SMN CreateMessageTemplate

This API is used to create a template. You can send messages based on the template to reduce the amount of data in requests.

Debug

Querying Details About a Message Template

hcloud SMN ListMessageTemplateDetails

This API is used to query details about a template, including the template content.

Debug

Updating a Message Template

hcloud SMN UpdateMessageTemplate

This API is used to modify the content of a message template.

Debug

Deleting a Message Template

hcloud SMN DeleteMessageTemplate

This API is used to delete a message template. After a template is deleted, you can no longer use it to publish messages.

Debug

Message Publishing

API Name

Command

Description

Operation

Publishing a Message

hcloud SMN PublishMessage

This API is used to send a message to all subscription endpoints of a topic. After the message ID is returned, the message has been saved and is to be pushed to the subscribers of the topic. To send messages to subscribers successfully, ensure that your message content complies with local laws and regulations.

Debug

Publishing a Detection Message

hcloud SMN PublishHttpDetect

This API is used to send an HTTP/HTTPS detection message to a topic to check whether the current HTTP/HTTPS endpoint is available and whether the SMN egress can access the endpoint.

Debug

Obtaining the HTTP Detection Result

hcloud SMN ShowHttpDetectResult

This API is used to query the detection result based on task_id returned by the HTTP detection.

Debug

Tags

API Name

Command

Description

Operation

Querying Resources by Tag

hcloud SMN ListResourceInstances

This API is used to query resources by tag.

Debug

Adding or Deleting Tags in a Batch

hcloud SMN BatchCreateOrDeleteResourceTags

This API is used to add or delete tags for a specified instance in a batch. A maximum of 10 tags can be added to a resource.

Debug

Querying Resource Tags

hcloud SMN ListResourceTags

This API is used to query tags of a specified instance.

Debug

Adding a Resource Tag

hcloud SMN CreateResourceTag

A maximum of 10 tags can be added to a resource. The API is idempotent. If a to-be-created tag has the same key as an existing tag, the tag will be created and overwrite the existing one.

Debug

Querying Project Tags

hcloud SMN ListProjectTags

This API is used to query all tags of a specified instance type for a tenant in a specific region.

Debug

Deleting a Resource Tag

hcloud SMN DeleteResourceTag

The API is idempotent. When deleting a tag, the system does not verify it. The tag key cannot be left blank or be an empty string. If the key of the tag to be deleted does not exist, 404 will be returned.

Debug

Applications

API Name

Command

Description

Operation

Querying Applications

hcloud SMN ListApplications

This API is used to query applications.

Debug

Creating an Application

hcloud SMN CreateApplication

This API is used to create an application.

Debug

Querying Application Attributes

hcloud SMN ListApplicationAttributes

This API is used to obtain attributes of an application.

Debug

Updating an Application

hcloud SMN UpdateApplication

This API is used to update an application.

Debug

Deleting an Application

hcloud SMN DeleteApplication

This API is used to delete an application.

Debug

Application Endpoints

API Name

Command

Description

Operation

Querying Application Endpoints

hcloud SMN ListApplicationEndpoints

This API is used to query application endpoints.

Debug

Creating an Application Endpoint

hcloud SMN CreateApplicationEndpoint

This API is used to create an application endpoint.

Debug

Querying Application Endpoint Attributes

hcloud SMN ListApplicationEndpointAttributes

This API is used to query attributes of an application endpoint.

Debug

Updating an Application Endpoint

hcloud SMN UpdateApplicationEndpoint

This API is used to update device attributes.

Debug

Deleting an Application Endpoint

hcloud SMN DeleteApplicationEndpoint

This API is used to delete a device.

Debug

Sending an Application Message

API Name

Command

Description

Operation

Sending an Application Message

hcloud SMN PublishAppMessage

This API is used to directly send a message to an endpoint.

Debug

API Version Query

API Name

Command

Description

Operation

Querying SMN API Versions

hcloud SMN ListVersions

This API is used to query the versions of SMN open APIs.

Debug

Querying Version Details of SMN API V2

hcloud SMN ListVersion

This API is used to query version details of SMN API V2.

Debug

Cloud Logs

API Name

Command

Description

Operation

Binding a Cloud Log

hcloud SMN CreateLogtank

This API is used to bind a cloud log to a specified topic to record information such as the message sending status.

Debug

Querying Cloud Logs

hcloud SMN ListLogtank

This API is used to query cloud logs bound to a specified topic.

Debug

Updating a Cloud Log

hcloud SMN UpdateLogtank

This API is used to update a cloud log bound to a specified topic.

Debug

Unbinding a Cloud Log

hcloud SMN DeleteLogtank

This API is used to unbind a log from a specified topic.

Debug

Message Filter Policies for Subscriptions

API Name

Command

Description

Operation

Creating Message Filter Policies for Subscriptions

hcloud SMN BatchCreateSubscriptionsFilterPolices

This API is used to create message filter policies for subscriptions.

Debug

Updating Message Filter Policies for Subscriptions

hcloud SMN BatchUpdateSubscriptionsFilterPolices

This API is used to update message filter policies for subscriptions.

Debug

Deleting Message Filter Policies for Subscriptions

hcloud SMN BatchDeleteSubscriptionsFilterPolices

This API is used to delete message filter policies for subscriptions.

Debug

Notification Policies

API Name

Command

Description

Operation

Creating a Notification Policy

hcloud SMN CreateNotifyPolicy

This API is used to create a notification policy.

Debug

Querying Notification Policies

hcloud SMN ShowNotifyPolicy

This API is used to query notification policies.

Debug

Modifying a Notification Policy

hcloud SMN UpdateNotifyPolicy

This API is used to modify a notification policy. You need to include all parameters required in the request body.

Debug

Deleting a Notification Policy

hcloud SMN DeleteNotifyPolicy

This API is used to delete a notification policy.

Debug

Protocols

API Name

Command

Description

Operation

Querying Protocols

hcloud SMN ListProtocols

This API is used to query the protocols supported by SMN.

Debug

Cloud Service Authorization

API Name

Command

Description

Operation

Querying Authorized Cloud Services

hcloud SMN ListCloudService

This API is used to query authorized cloud services.

Debug

Querying Authorized Services

hcloud SMN ListCloudServices

This API is used to query authorized services.

Debug

Certificates

API Name

Command

Description

Operation

Downloading a Certificate

hcloud SMN DownloadHttpCert

This API is used to download an HTTP message verification certificate.

Debug

Downloading an HTTP Signature Certificate

hcloud SMN DownloadHttpSignCert

This API is used to download an HTTP signature certificate.

Debug

Keys

API Name

Command

Description

Operation

Binding a KMS Key to a Topic

hcloud SMN CreateKmsKey

This API is used to bind a KMS key to a topic. A KMS key is applied 5 minutes later after being bound to a topic. After a KMS key is applied, all messages published to the topic, including subscription confirmation messages, subscription cancellation messages, and topic messages, are encrypted and decrypted using the data key of the KMS key, and then transmitted in SMN. Before binding a KMS key, create an agency named smn_kms_agency on IAM and assign resource operation permissions to SMN. SMN uses this agency to create a data key.

Debug

Querying the KMS Key Bound to a Topic

hcloud SMN ShowKmsKey

This API is used to query the ID of the key bound to a topic. Before binding a KMS key, create an agency named smn_kms_agency on IAM and assign resource operation permissions to SMN. SMN uses this agency to query key information.

Debug

Updating the KMS Key Bound to a Topic

hcloud SMN UpdateKmsKey

This API is used to update the key ID. Before updating a KMS key, create an agency named smn_kms_agency on IAM and assign resource operation permissions to SMN. SMN uses this agency to query the key status and create a data key.

Debug

Deleting the KMS Key Bound to a Topic

hcloud SMN DeleteKmsKey

This API is used to delete the key bound to a topic.

Debug