Get all streams

Get all streams that the user has access to.

GET https://omegaletter.chat/api/v1/streams

Usage examples

curl https://omegaletter.chat/api/v1/streams -u BOT_EMAIL_ADDRESS:BOT_API_KEY

You may pass in one or more of the parameters mentioned above as URL query parameters, like so:

curl https://omegaletter.chat/api/v1/streams?include_public=false \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY
#!/usr/bin/env python3

import zulip

# Download ~/zuliprc-dev from your dev server
client = zulip.Client(config_file="~/zuliprc-dev")

# Get all streams that the user has access to
result = client.get_streams()
print(result)

# You may pass in one or more of the query parameters mentioned above
# as keyword arguments, like so:
result = client.get_streams(include_public=False)
print(result)

More examples and documentation can be found here.

const zulip = require('zulip-js');

// Download zuliprc-dev from your dev server
const config = {
    zuliprc: 'zuliprc-dev',
};

zulip(config).then((client) => {
    // Get all streams that the user has access to
    client.streams.retrieve().then(console.log);
});

Arguments

Note: The following arguments are all URL query parameters.

Argument Example Required Description
include_public `True` or `False` Optional

Include all public streams. Default is True.

include_subscribed `True` or `False` Optional

Include all streams that the user is subscribed to. Default is True.

include_all_active `True` or `False` Optional

Include all active streams. The user must have administrative privileges to use this parameter. Default is False.

include_default `True` or `False` Optional

Include all default streams for the user's realm. Default is False.

Response

Return values

  • stream_id: The unique ID of a stream.
  • name: The name of a stream.
  • description: A short description of a stream.
  • invite-only: Specifies whether a stream is invite-only or not. Only people who have been invited can access an invite-only stream.

Example response

A typical successful JSON response may look like:

{
    "msg": "",
    "result": "success",
    "streams": [
        {
            "description": "A Scandinavian country",
            "invite_only": false,
            "name": "Denmark",
            "stream_id": 1
        },
        {
            "description": "Yet another Italian city",
            "invite_only": false,
            "name": "Rome",
            "stream_id": 2
        },
        {
            "description": "Located in the United Kingdom",
            "invite_only": false,
            "name": "Scotland",
            "stream_id": 3
        },
        {
            "description": "A northeastern Italian city",
            "invite_only": false,
            "name": "Venice",
            "stream_id": 4
        },
        {
            "description": "A city in Italy",
            "invite_only": false,
            "name": "Verona",
            "stream_id": 5
        },
        {
            "description": "New stream for testing",
            "invite_only": false,
            "name": "new stream",
            "stream_id": 6
        }
    ]
}

An example of a JSON response for when the user is not authorized to use the include_all_active parameter:

{
    "code": "BAD_REQUEST",
    "msg": "User not authorized for this query",
    "result": "error"
}