Deletes a topic.

Notice After a topic is deleted, all messages in the topic and all subscriptions to the topic are deleted and cannot be restored. Proceed with caution.

Authorization

By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after these RAM users are granted related permissions. The following table describes the authorization information of this operation. For more information, see Permission policies and examples.

Item Value
API operation DeleteTopic
Action mns:DeleteTopic
Resource acs:mns:$region:$accountid:/topics/$topicName

Request

A request consists of the following parts:

  • Request line

    DELETE /topics/$TopicName HTTP/1.1

  • Operation-specific request headers

    None.

  • Request body

    None.

Response

A response consists of the following parts:

  • HTTP status code

    HTTP/1.1 204 No Content

    If the topic is deleted, the 204 No Content message is returned.

  • Operation-specific response headers

    None.

  • Response body

    None.

Examples

Sample requests

DELETE /topics/$TopicName HTTP/1.1
Host: $AccountId.mns.cn-hangzhou.aliyuncs.com
Date: Tue, 08 Dec 2015 06:05:08 GMT
Authorization: MNS 15B4D3461F177624206A:xit63dyKs83PTJF0hx3fd04C****
x-mns-version: 2015-06-06

Sample success responses

HTTP/1.1 204 No Content
x-mns-request-id: 56667314B2B71C9C1600****
x-mns-version: 2015-06-06

Error codes

No operation-specific errors occur when you call this operation. Common errors include unauthorized access and invalid parameters. For more information, see Error codes.