Page tree
Skip to end of metadata
Go to start of metadata

Edit a smart group by sending the POST method to the following URL: /group/smart/{group_id}.

Permissions to run the request: Account OwnerAdministratorsDepartment Administrators or users with a role with custom settings, allowing to edit smart groups.

Request Headers

Parameter

Description

X-Auth-Account-Url (required)The base URL of the account, e.g. http://myaccount.ispringlearn.com.
X-Auth-Email (required)The login of Account OwnerAdministratorsDepartment Administrators or a user with a role with custom settings allowing to edit smart groups.
X-Auth-Password (required)The login of Account OwnerAdministratorsDepartment Administrators or a user with a role with custom settings allowing to edit smart groups.
group_id (required)The ID of a group you want to edit.
name (optional)The name of a group you want to edit.
attributeType (required)

Can have the following values:

  • 1— department

  • 2 — group

  • 3 — user profile field

attributeId (optional)

The user field ID. Should be filled out only if attributeType is 3.

operator (required)

For departments:

  • 1 — a single department without any daughter departments 
  • 2 — a department and all its daughter departments 

For groups and user fields:

  • always 1
value (required)

For departments:

  • the department ID

For groups:

  • the group ID

For user profile fields:

  • the user profile field value (for example, the value for the Last Name field is Smith)

Note: for the Country field, use the country ID, not its name. The country ID can be obtained with the Getting User Profile Fields method.

You can add multiple groups of conditions that should be satisfied to add a user to a smart group. All groups of conditions should be met at the same time.

Inside these groups of conditions, add rules. Any of the rules can be completed so that a user was added to the smart group.

Read more about smart groups, their rules and conditions in the Creating Smart Groups article.

Response Codes

Code

Text

Description

200Successful operationThe smart group has been successfully edited.
400Bad RequestSome of the sent parameters are incorrect.
401UnauthorizedAn authorization error.
403Permission deniedThe user doesn't have enough permissions to add smart groups

Sample Request

POST /group/smart/b1496214-acab-11e9-8db0-120a62f268a9/ HTTP/1.1
Host: api-learn.ispringlearn.com
X-Auth-Account-Url: http://myaccount.ispringlearn.com
X-Auth-Email: email@email.com
X-Auth-Password: password
Content-Type:application/xml
  
<?xml version="1.0" encoding="UTF-8"?>
<request>
    <name>New Group</name>
    <rules>
        <and>
            <or>
                <rule>
                    <attributeType>1</attributeType>
                    <attributeId></attributeId>
                    <operator>1</operator>
                    <value>6f774f46-de00-11e9-bb11-0a580af40984</value>
                </rule>
            </or>
            <or>
                 <rule>
                    <attributeType>2</attributeType>
                    <attributeId></attributeId>
                    <operator>1</operator>
                    <value>eb53de1e-dea4-11e9-8de4-0a580af40738</value>
                </rule>
            </or>
            <or>
                <rule>
                     <attributeType>3</attributeType>
                     <attributeId>14072df2-d54f-11e9-a7ce-0a580af40973</attributeId>
                     <operator>1</operator>
                     <value>Support Manager</value>
                </rule>
            </or>
        </and>
    </rules>
</request>    

Sample Response

HTTP/1.1 200 Successful operation
Connection: close
  • No labels