Adding a New Smart Group
AVAILABLE WITH BUSINESS SUBSCRIPTION
Request: POST /group/smart
Permissions to Run the Request
Account Owner, Account Administrators, Department Administrators, or custom roles.
Request Headers
Header | Description |
---|---|
X-Auth-Account-Url (required) | The base URL of the account, e.g. https://myaccount.ispringlearn.com. |
X-Auth-Email (required) | The login of Account Owner, Administrators, Department Administrators, or a user with a role with custom settings allowing to create new smart groups. |
X-Auth-Password (required) | The password of Account Owner, Administrators, Department Administrators or a user with a role with custom settings allowing to create new smart groups. |
Parameter | Description |
attributeType (required) | Can have the following values:
|
attributeId (optional) | The user field ID. Should be filled out only if attributeType is 3. |
operator (required) | For departments:
For groups and user fields:
|
value (required) | For departments:
For groups:
For user profile fields:
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
201 | Created | A new smart group has been added. |
400 | Bad Request | Some of the sent parameters are incorrect. |
401 | Unauthorized | An authorization error. |
403 | Permission denied | The user doesn't have enough permissions to add smart groups |
Code | Text | Description |
---|
Sample Request
POST /group/smart https/1.1
Host: api-learn.ispringlearn.com
X-Auth-Account-Url: https://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>Active Sales</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>JOB_TITLE</attributeId>
<operator>1</operator>
<value>Sales Manager</value>
</rule>
</or>
</and>
</rules>
</request>
Sample Response
https/1.1 201 Created
<?xml version="1.0" encoding="UTF-8"?>
<response>3fa85f64-5717-4562-b3fc-2c963f66afa6</response>