Create a user group

Create a new user group.

POST https://pignonfixe.zulipchat.com/api/v1/user_groups/create

Usage examples

#!/usr/bin/env python3

import zulip

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

request = {
    'name': 'marketing',
    'description': 'The marketing team.',
    'members': [6, 7, 8, 10],
}

result = client.create_user_group(request)
print(result)

curl -sSX POST https://pignonfixe.zulipchat.com/api/v1/user_groups/create \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY \
    -d 'name=marketing' \
    -d 'description=The marketing team.' \
    --data-urlencode members='[1, 2, 3, 4]'

Parameters

name required

Example: marketing

The name of the user group.


description required

Example: The marketing team.

The description of the user group.


members required

Example: [1, 2, 3, 4]

An array containing the user IDs of the initial members for the new user group.


Response

Example response

A typical successful JSON response may look like:

{
    "msg": "",
    "result": "success"
}

An example JSON error response for when the one of the users does not exist:

{
    "code": "BAD_REQUEST",
    "msg": "Invalid user ID: 500",
    "result": "error"
}