Update stream

Configure the stream with the ID stream_id. This endpoint supports an organization administrator editing any property of a stream, including:

PATCH https://zephyr.zulipchat.com/api/v1/streams/{stream_id}

Usage examples

#!/usr/bin/env python3

import zulip

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

# Update the stream by a given ID
request = {
    'stream_id': stream_id,
    'stream_post_policy': 2,
    'is_private': True,

result = client.update_stream(request)

curl -sSX PATCH https://zephyr.zulipchat.com/api/v1/streams/42 \
    -d 'description="This stream is related to football dicsussions."' \
    -d 'new_name="Italy"' \
    -d 'is_private=true'


stream_id required

Example: 42

The ID of the stream to access.

description optional

Example: "This stream is related to football dicsussions."

The new description for the stream.

new_name optional

Example: "Italy"

The new name for the stream.

is_private optional

Example: true

Change whether the stream is a private stream.

is_announcement_only optional

Example: true

Whether the stream is limited to announcements.

Changes: Deprecated in Zulip 2.2 (feature level 1), use stream_post_policy instead.

stream_post_policy optional

Example: 2

Policy for which users can post messages to the stream.

  • 1 => Any user can post.
  • 2 => Only administrators can post.
  • 3 => Only new members can post.

Changes: New in Zulip 2.2, replacing the previous is_announcement_only boolean.

Defaults to 1.

history_public_to_subscribers optional

Example: false

Whether the stream's message history should be available to newly subscribed members, or users can only access messages they actually received while subscribed to the stream.

Corresponds to the shared history option in documentation.

Defaults to "None".


Return values

  • stream_id: The ID of the stream to be updated.

Example response

A typical successful JSON response may look like:

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

An example JSON response for when the supplied stream does not exist:

    "code": "BAD_REQUEST",
    "msg": "Invalid stream id",
    "result": "error"