Group API¶
The Group API manages user groups and their configurations in Unique AI.
Overview¶
Organize users into groups for permission management and access control.
Methods¶
unique_sdk.Group.create_group - Create a new group
Compatibility
Compatible with release >.48
Create a new group in a company.
Parameters:
name(str, required) - Group nameexternalId(str, optional) - External system IDparentId(str, optional) - Parent group ID for nesting
Returns:
Returns a Group object.
Example:
unique_sdk.Group.get_groups - Get groups with filtering
Compatibility
Compatible with release >.48
Get groups with optional filtering and pagination.
Parameters:
skip(int, optional) - Number of records to skip (default: 0)take(int, optional) - Number of records to return (default: 50, max: 1000)name(str, optional) - Filter by group name
Returns:
Returns a Groups object.
Example:
Filter by Name:
unique_sdk.Group.update_group - Update group name
Compatibility
Compatible with release >.48
Update a group's name.
Parameters:
group_id(str, required) - Group ID to updatename(str, optional) - New group name
Returns:
Returns a Group object.
Example:
unique_sdk.Group.add_users_to_group - Add users to group
Compatibility
Compatible with release >.48
Add multiple users to a group.
Parameters:
group_id(str, required) - Group ID to add users touserIds(List[str], required) - List of user IDs to add
Returns:
Returns an AddUsersToGroupResponse object.
Example:
unique_sdk.Group.remove_users_from_group - Remove users from group
Compatibility
Compatible with release >.48
Remove multiple users from a group.
Parameters:
group_id(str, required) - Group ID to remove users fromuserIds(List[str], required) - List of user IDs to remove
Returns:
Returns a RemoveUsersFromGroupResponse object.
Example:
unique_sdk.Group.update_group_configuration - Update group configuration
Compatibility
Compatible with release >.48
Update group configuration (JSON object).
Parameters:
group_id(str, required) - Group ID to updateconfiguration(Dict[str, Any], required) - Group configuration dictionary
Returns:
Returns a GroupWithConfiguration object.
Example:
unique_sdk.Group.delete_group - Delete a group
Compatibility
Compatible with release >.48
Delete a group by ID.
Parameters:
group_id(str, required) - Group ID to delete
Returns:
Returns a DeleteResponse object.
Example:
Use Cases¶
Team Setup
Bulk User Management
Permission Management
Group Configuration
Best Practices¶
Hierarchical Organization
Return Types¶
Group¶
The Group object represents a group in the company
Fields:
id(str) - Unique group identifiername(str) - Group nameexternalId(str) - External system identifierparentId(str | None) - Parent group ID for nestingmembers(List[GroupMember] | None) - List of group members. SeeGroup.GroupMemberfor structure.createdAt(str) - Creation timestamp (ISO 8601)updatedAt(str) - Last update timestamp (ISO 8601)
Returned by: Group.create_group(), Group.update_group()
GroupMember¶
The GroupMember object represents a member of a group
Fields:
entityId(str) - User ID of the member
Used in: Group.members
GroupWithConfiguration¶
The GroupWithConfiguration object represents a group with configuration
Fields:
- All fields from
Group configuration(Dict[str, Any]) - Group configuration dictionary
Returned by: Group.update_group_configuration()
Groups¶
The Groups object contains a list of groups
Fields:
groups(List[Group]) - List of group objects. SeeGroupfor structure.
Returned by: Group.get_groups()
AddUsersToGroupResponse¶
The AddUsersToGroupResponse object contains membership information
Fields:
memberships(List[GroupMembership]) - List of created memberships. SeeGroupMembershipfor structure.
Returned by: Group.add_users_to_group()
GroupMembership¶
The GroupMembership object represents a membership relationship
Fields:
entityId(str) - User IDgroupId(str) - Group IDcreatedAt(str) - Creation timestamp (ISO 8601)
Used in: AddUsersToGroupResponse.memberships
RemoveUsersFromGroupResponse¶
The RemoveUsersFromGroupResponse object indicates removal success
Fields:
success(bool) - Whether removal was successful
Returned by: Group.remove_users_from_group()
DeleteResponse¶
The DeleteResponse object contains the deleted group ID
Fields:
id(str) - ID of the deleted group
Returned by: Group.delete_group()
Related Resources¶
- User API - Manage individual users
- Folder API - Manage folder access for groups