Smart Groups

Smart Groups in Connecteam allow you to organize users dynamically based on custom field values. Users are automatically added or removed from groups based on their matching criteria.

Available Endpoints

MethodEndpointDescription
GET/users/v1/smart-groupsList all smart groups
POST/users/v1/smart-groupsCreate a new smart group
PUT/users/v1/smart-groups/{smartGroupId}Update an existing smart group
DELETE/users/v1/smart-groups/{smartGroupId}Delete a smart group
GET/users/v1/smart-group-segmentsList all smart group segments
POST/users/v1/smart-group-segmentsCreate a new segment

Get Smart Groups

GET /users/v1/smart-groups

Query Parameters

ParameterTypeDescription
idintegerFilter by smart group ID
namestringFilter by smart group name

Response Example

{
  "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "data": {
    "smartGroups": [
      {
        "id": 123456,
        "name": "Sales Team",
        "description": "All users in sales department",
        "segmentId": 789,
        "usersCount": 25
      }
    ]
  }
}

Create Smart Group

POST /users/v1/smart-groups

Request Body

FieldTypeRequiredDescription
namestringYesUnique name for the smart group
groupSegmentIdintegerYesID of the segment this group belongs to
descriptionstringNoDescription of the smart group
filtersarrayNoArray of filter objects (dropdown custom fields only)

Filters Structure

Filters allow you to automatically include users based on dropdown custom field values:

{
  "filters": [
    {
      "customFieldId": 123456,
      "optionIds": [1, 2, 3]
    }
  ]
}
📝

Note

Currently, only dropdown custom fields are supported for filters. Other field types cannot be used as filter criteria.

Request Example

{
  "name": "Marketing Team",
  "groupSegmentId": 789,
  "description": "All users in marketing department",
  "filters": [
    {
      "customFieldId": 6208757,
      "optionIds": [1, 2]
    }
  ]
}

Success Response (201)

{
  "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "data": {
    "id": 123456,
    "name": "Marketing Team",
    "description": "All users in marketing department",
    "segmentId": 789
  }
}

Error Responses

StatusErrorDescription
400Invalid segmentThe specified segment ID does not exist
400Invalid custom fieldCustom field ID not found or not a dropdown type
400Invalid option IDOption ID does not exist for the custom field
409Group name already existsA smart group with this name already exists

Update Smart Group

PUT /users/v1/smart-groups/{smartGroupId}

Request Body

Same structure as Create. Fields not specified will remain unchanged.

🚧

Important

Filter changes will override existing filters entirely. Include all desired filters in the update request.


Delete Smart Group

DELETE /users/v1/smart-groups/{smartGroupId}

Success Response (200)

{
  "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "data": {
    "success": true
  }
}

Error Responses

StatusErrorDescription
404Smart group not foundThe specified smart group ID does not exist

Smart Group Segments

Segments are categories that contain smart groups. Before creating a smart group, you need to know the segment ID.

Get Segments

GET /users/v1/smart-group-segments

Response Example

{
  "requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "data": {
    "segments": [
      {
        "id": 789,
        "name": "Departments"
      }
    ]
  }
}

Create Segment

POST /users/v1/smart-group-segments

{
  "name": "Locations"
}

Smart Groups API reference