Topic muting
This endpoint mutes/unmutes a topic within a stream that the current
user is subscribed to. Muted topics are displayed faded in the Zulip
UI, and are not included in the user's unread count totals.
PATCH https://zulip.hopi.cz/api/v1/users/me/subscriptions/muted_topics
Usage examples
#!/usr/bin/env python3
import zulip
# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")
# Mute the topic "boat party" in the stream "Denmark"
request = {
'stream': 'Denmark',
'topic': 'boat party',
'op': 'add'
}
result = client.mute_topic(request)
print(result)
# Unmute the topic "boat party" in the stream "Denmark"
request = {
'stream': 'Denmark',
'topic': 'boat party',
'op': 'remove'
}
result = client.mute_topic(request)
print(result)
curl -X PATCH https://zulip.hopi.cz/api/v1/users/me/subscriptions/muted_topics \
-u BOT_EMAIL_ADDRESS:BOT_API_KEY \
-d "stream=Verona"
-d "topic=dinner"
-d "op=add"
Arguments
Argument |
Example |
Required |
Description |
stream |
"Verona" |
Yes |
The name of the stream in which to mute the topic. |
topic |
"dinner" |
Yes |
The topic to (un)mute. Note that the request will succeed regardless of whether any messages have been sent to the specified topic. |
op |
"add" |
Yes |
Whether to mute (add ) or unmute (remove ) the provided topic.
Must be one of: add , remove . |
Response
Example response
A typical successful JSON response may look like:
{
"msg": "",
"result": "success"
}
An example JSON response for when an add
operation is requested for a topic
that has already been muted:
{
"msg": "Topic already muted",
"result": "error"
}
An example JSON response for when a remove
operation is requested for a
topic that had not been previously muted:
{
"msg": "Topic is not muted",
"result": "error"
}