Update a User Group

Purpose

To update a user group.

Request Details

Request URL

{api-domain}/crm/{version}/settings/user_groups/{user_group_id}

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope=ZohoCRM.settings.user_groups.UPDATE

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v4/settings/user_groups/3652397000009949005"
-X PUT
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

Input JSON

  • namestring, mandatory

    The name of the user group. Accepts alphanumeric characters. Note that the name must be unique for each group.

  • descriptionstring, optional

    The description of the user group.

  • sourceJSON array, mandatory

    Each JSON object in this array consists of the following keys:

    • typestring, mandatory
      The type of member you want to add to the user group. The possible values are users, roles, groups, and territories.
    • sourceJSON object, mandatory
      The API name and ID of the user, group, role, or territory you want to add to the user group. If your "type" is "roles", you must only give the details of the role, here.
    • subordinatesboolean, optional
      When the type is "roles" or "territories", this key represents whether you want to assign the subordinate roles or child territories to the user group, too.
    • _deleteboolean, mandatory
      when you want to delete a member - The value "true" deletes the member from the user group.

Sample Input

Copied{
    "user_groups": [
        {
            "name": "test group",
            "description": "my group",
            "sources": [
                {
                    "source": {
                        "name": "Patricia Boyle",
                        "id": "3652397000000186017"
                    },
                    "type": "users"
                },
                {
                    "source": {
                        "name": "Manager",
                        "id": "3652397000000026008"
                    },
                    "type": "roles",
                    "subordinates": true
                },
                {
                    "source": {
                        "name": "New York",
                        "id": "3652397000007622003"
                    },
                    "type": "territories",
                    "subordinates": true
                },
                {
                    "source": {
                        "name": "Deborah Gill",
                        "id": "3652397000000281001"
                    },
                    "type": "users",
                    "_delete":true
                }
            ]
        }
    ]
}

Possible Errors

  • INVALID_DATAHTTP 400
    • The role or territory ID is invalid.
    • The user group ID is invalid.

    Resolution: Refer to the "details" key in the response for the exact error and rectify it accordingly.

  • NO_PERMISSIONHTTP 403

    You do not have permission to update a user group.
    Resolution: Contact your administrator to obtain the "Manage Groups" permission to be able to create a user group.

Sample Response

Copied{
    "user_groups": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "3652397000009949005"
            },
            "message": "User Group Updated successfully",
            "status": "success"
        }
    ]
}