POST /user_topics

This endpoint is used to update the personal preferences for a topic, such as the topic's visibility policy, which is used to implement mute a topic and related features.

This endpoint can be used to update the visibility policy for the single channel and topic pair indicated by the parameters for a user.

Changes: New in Zulip 7.0 (feature level 170). Previously, toggling whether a topic was muted or unmuted was managed by the PATCH /users/me/subscriptions/muted_topics endpoint.

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/x-www-form-urlencoded"

Request body fields

Name Type Required Description
stream_id Integer Yes

The ID of the channel to access.

topic String Yes

The topic for which the personal preferences needs to be updated. Note that the request will succeed regardless of whether any messages have been sent to the specified topic.

Clients should use the max_topic_length returned by the POST /register endpoint to determine the maximum topic length.

Note: When the value of realm_empty_topic_display_name found in the POST /register response is used for this parameter, it is interpreted as an empty string.

Changes: Before Zulip 10.0 (feature level 334), empty string was not a valid topic name for channel messages.

visibility_policy Integer Yes

Controls which visibility policy to set.

  • 0 = None. Removes the visibility policy previously set for the topic.
  • 1 = Muted. Mutes the topic in a channel.
  • 2 = Unmuted. Unmutes the topic in a muted channel.
  • 3 = Followed. Follows the topic.

In an unmuted channel, a topic visibility policy of unmuted will have the same effect as the "None" visibility policy.

Changes: In Zulip 7.0 (feature level 219), added followed as a visibility policy option.

Valid values:

  • 0
  • 1
  • 2
  • 3

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.