Deactivate a user group

POST https://balena.zulipchat.com/api/v1/user_groups/{user_group_id}/deactivate

Deactivate a user group. Deactivated user groups cannot be used for mentions, permissions, or any other purpose, but can be reactivated or renamed.

Deactivating user groups is preferable to deleting them from the database, since the deactivation model allows audit logs of changes to sensitive group-valued permissions to be maintained.

Changes: New in Zulip 10.0 (feature level 290).

Usage examples

curl -sSX POST https://balena.zulipchat.com/api/v1/user_groups/35/deactivate \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY

Parameters

user_group_id integer required in path

Example: 35

The ID of the target user group.


Response

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"
}

An example JSON response when the user group ID is invalid.

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

An example JSON response when the user group being deactivated is used for a setting or as a subgroup.

Changes: New in Zulip 10.0 (feature level 298). Previously, this error returned the "BAD_REQUEST" code.

{
    "code": "CANNOT_DEACTIVATE_GROUP_IN_USE",
    "msg": "Cannot deactivate user group in use.",
    "objections": [
        {
            "settings": [
                "can_create_public_channel_group"
            ],
            "type": "realm"
        }
    ],
    "result": "error"
}