2018-08-18 23:06:53 +02:00
|
|
|
# Get user groups
|
|
|
|
|
|
|
|
Fetches all of the user groups in the organization.
|
|
|
|
|
2019-07-27 07:12:29 +02:00
|
|
|
**Note**: Only organization members or admins can contact this
|
|
|
|
endpoint; bots and guests cannot contact this endpoint.
|
|
|
|
|
2018-08-18 23:06:53 +02:00
|
|
|
`GET {{ api_url }}/v1/user_groups`
|
|
|
|
|
|
|
|
## Usage examples
|
|
|
|
|
2019-06-25 07:22:00 +02:00
|
|
|
{start_tabs}
|
|
|
|
{tab|python}
|
2018-08-18 23:06:53 +02:00
|
|
|
|
2019-06-25 07:22:00 +02:00
|
|
|
{generate_code_example(python)|/user_groups:get|example}
|
|
|
|
|
|
|
|
{tab|curl}
|
2018-08-18 23:06:53 +02:00
|
|
|
|
2019-05-16 22:38:53 +02:00
|
|
|
``` curl
|
2019-04-17 21:08:35 +02:00
|
|
|
curl -X GET {{ api_url }}/v1/user_groups \
|
2019-07-27 07:12:29 +02:00
|
|
|
-u USER_EMAIL_ADDRESS:USER_API_KEY
|
2018-08-18 23:06:53 +02:00
|
|
|
```
|
|
|
|
|
2019-06-25 07:22:00 +02:00
|
|
|
{end_tabs}
|
2018-08-18 23:06:53 +02:00
|
|
|
|
|
|
|
## Arguments
|
|
|
|
|
|
|
|
{generate_api_arguments_table|zulip.yaml|/user_groups:get}
|
|
|
|
|
|
|
|
## Response
|
|
|
|
|
|
|
|
#### Return values
|
|
|
|
|
|
|
|
* `user_groups`: A list of dictionaries, where each dictionary contains information
|
|
|
|
about a user group.
|
|
|
|
* `description`: The human-readable description of the user group.
|
|
|
|
* `id`: The user group's integer id.
|
|
|
|
* `members`: The integer User IDs of the user group members.
|
|
|
|
* `name`: User group name.
|
|
|
|
|
|
|
|
#### Example response
|
|
|
|
|
|
|
|
A typical successful JSON response may look like:
|
|
|
|
|
|
|
|
{generate_code_example|/user_groups:get|fixture(200)}
|