groups
Classes
GroupsClient
GroupsClient(client: OWUIClientBase)
Bases: ResourceBase
Client for the Groups endpoints.
- Code Reference client Classes OpenWebUI Attributes groups
Source code in src/owui_client/client_base.py
Functions
get_groups
get_groups(
share: Optional[bool] = None,
) -> list[GroupResponse]
Get all groups.
Retrieves a list of all groups available to the user. Admin users can see all groups. Regular users only see groups they are members of.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
share
|
Optional[bool]
|
Filter by share status. If True, returns only shared groups. If False, returns only non-shared groups. If None, returns all groups (subject to user role). |
None
|
Returns:
| Type | Description |
|---|---|
list[GroupResponse]
|
List of groups. |
Source code in src/owui_client/routers/groups.py
create_new_group
create_new_group(
form_data: GroupForm,
) -> Optional[GroupResponse]
Create a new group.
Creates a new user group with the provided details. Requires admin privileges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
GroupForm
|
The group creation information including name, description, and permissions. |
required |
Returns:
| Type | Description |
|---|---|
Optional[GroupResponse]
|
The created group if successful, None otherwise. |
Source code in src/owui_client/routers/groups.py
get_group_by_id
get_group_by_id(id: str) -> Optional[GroupResponse]
Get group by ID.
Retrieves details of a specific group by its ID. Requires admin privileges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The unique identifier of the group. |
required |
Returns:
| Type | Description |
|---|---|
Optional[GroupResponse]
|
The group details if found, None otherwise. |
Source code in src/owui_client/routers/groups.py
export_group_by_id
export_group_by_id(
id: str,
) -> Optional[GroupExportResponse]
Export group by ID (includes user IDs).
Retrieves group details along with the list of member user IDs. Useful for backing up or migrating group data. Requires admin privileges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The unique identifier of the group. |
required |
Returns:
| Type | Description |
|---|---|
Optional[GroupExportResponse]
|
The exported group details including member user IDs if found, None otherwise. |
Source code in src/owui_client/routers/groups.py
get_users_in_group
get_users_in_group(id: str) -> list[UserInfoResponse]
Get users in a group.
Retrieves the list of users who are members of the specified group. Requires admin privileges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The unique identifier of the group. |
required |
Returns:
| Type | Description |
|---|---|
list[UserInfoResponse]
|
List of user information for members of the group. |
Source code in src/owui_client/routers/groups.py
update_group_by_id
update_group_by_id(
id: str, form_data: GroupUpdateForm
) -> Optional[GroupResponse]
Update group by ID.
Updates the details of an existing group. Requires admin privileges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The unique identifier of the group. |
required |
form_data
|
GroupUpdateForm
|
The updated group information. |
required |
Returns:
| Type | Description |
|---|---|
Optional[GroupResponse]
|
The updated group details if successful, None otherwise. |
Source code in src/owui_client/routers/groups.py
add_user_to_group
add_user_to_group(
id: str, form_data: UserIdsForm
) -> Optional[GroupResponse]
Add users to group.
Adds one or more users to the specified group. Requires admin privileges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The unique identifier of the group. |
required |
form_data
|
UserIdsForm
|
Form containing the list of user IDs to add. |
required |
Returns:
| Type | Description |
|---|---|
Optional[GroupResponse]
|
The updated group details if successful, None otherwise. |
Source code in src/owui_client/routers/groups.py
remove_users_from_group
remove_users_from_group(
id: str, form_data: UserIdsForm
) -> Optional[GroupResponse]
Remove users from group.
Removes one or more users from the specified group. Requires admin privileges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The unique identifier of the group. |
required |
form_data
|
UserIdsForm
|
Form containing the list of user IDs to remove. |
required |
Returns:
| Type | Description |
|---|---|
Optional[GroupResponse]
|
The updated group details if successful, None otherwise. |
Source code in src/owui_client/routers/groups.py
delete_group_by_id
Delete group by ID.
Permanently deletes the specified group. Requires admin privileges.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The unique identifier of the group. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the group was successfully deleted, False otherwise. |