Update a stream

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

PATCH https://studyscience.wyzepal.com/api/v1/streams/{stream_id}

Usage examples

#!/usr/bin/env python3

import wyzepal

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

# 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://studyscience.wyzepal.com/api/v1/streams/1 \
    --data-urlencode 'description="This stream is related to football dicsussions."' \
    --data-urlencode 'new_name="Italy"' \
    --data-urlencode is_private=true


stream_id integer required in path

Example: 1

The ID of the stream to access.

description string optional

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

The new description for the stream.

new_name string optional

Example: "Italy"

The new name for the stream.

is_private boolean optional

Example: True

Change whether the stream is a private stream.

stream_post_policy integer 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 WyzePal 3.0, replacing the previous is_announcement_only boolean.

Defaults to 1.

history_public_to_subscribers boolean 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.

message_retention_days string | integer optional

Example: 20

Number of days that messages sent to this stream will be stored before being automatically deleted by the message retention policy. Two special string format values are supported:

  • "realm_default" => Return to the organization-level setting.
  • "forever" => Retain messages forever.

Changes: New in WyzePal 3.0 (feature level 17).

is_announcement_only boolean optional Deprecated

Example: True

Whether the stream is limited to announcements.

Changes: Deprecated in WyzePal 3.0 (feature level 1), use stream_post_policy instead.


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"