Get user groups
GET https://stadium.zulipchat.com/api/v1/user_groups
Fetches all of the user groups in the organization.
Usage examples
#!/usr/bin/env python3
import zulip
# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")
# Get all user groups of the organization.
result = client.get_user_groups()
print(result)
curl -sSX GET -G https://stadium.zulipchat.com/api/v1/user_groups \
-u BOT_EMAIL_ADDRESS:BOT_API_KEY \
--data-urlencode include_deactivated_groups=true
Parameters
include_deactivated_groups boolean optional
Example: true
Whether to include deactivated user groups in the response.
Changes: In Zulip 10.0 (feature level 294), renamed
allow_deactivated
to include_deactivated_groups
.
New in Zulip 10.0 (feature level 290). Previously, deactivated
user groups did not exist and thus would never be included in
the response.
Defaults to false
.
Response
Return values
Example response(s)
Changes: As of Zulip 7.0 (feature level 167), if any
parameters sent in the request are not supported by this
endpoint, a successful JSON response will include an
ignored_parameters_unsupported
array.
A typical successful JSON response may look like:
{
"msg": "",
"result": "success",
"user_groups": [
{
"can_add_members_group": 16,
"can_join_group": 16,
"can_leave_group": 15,
"can_manage_group": 16,
"can_mention_group": 11,
"creator_id": null,
"date_created": null,
"description": "Owners of this organization",
"direct_subgroup_ids": [],
"id": 1,
"is_system_group": true,
"members": [
1
],
"name": "role:owners"
},
{
"can_add_members_group": 17,
"can_join_group": 17,
"can_leave_group": 15,
"can_manage_group": 17,
"can_mention_group": 12,
"creator_id": null,
"date_created": null,
"description": "Administrators of this organization, including owners",
"direct_subgroup_ids": [
1
],
"id": 2,
"is_system_group": true,
"members": [
2
],
"name": "role:administrators"
},
{
"can_add_members_group": 20,
"can_join_group": 20,
"can_leave_group": 15,
"can_manage_group": 20,
"can_mention_group": 13,
"creator_id": null,
"date_created": 1717484476,
"description": "Characters of Hamlet",
"direct_subgroup_ids": [],
"id": 3,
"is_system_group": false,
"members": [
3,
4
],
"name": "hamletcharacters"
}
]
}