Delete a topic

Delete all messages in a topic.


Topics are a field on messages (not an independent data structure), so deleting all the messages in the topic deletes the topic from Zulip.

Usage examples

#!/usr/bin/env python3

import zulip

# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")

# Delete a topic given its stream_id
request = {
    "topic_name": topic,
result = client.call_endpoint(
    url=f"/streams/{stream_id}/delete_topic", method="POST", request=request

curl -sSX POST \
    --data-urlencode 'topic_name=new coffee machine'


stream_id integer required in path

Example: 1

The ID of the stream to access.

topic_name string required

Example: "new coffee machine"

The name of the topic to delete.


Example response

A typical successful JSON response may look like:

    "msg": "",
    "result": "success"

Error when the user does not have permission to delete topics in this organization:

    "msg": "Must be an organization administrator",
    "result": "error"