Groups

class matterapi.endpoints.async_api.GroupsApi(client: matterapi.client.base.BaseClient, skip_response_parsing: bool = False)

Endpoints related to LDAP groups.

async add_group_members(group_id: str, *, json_body: Union[matterapi.models.AddGroupMembersJsonBody, Dict]) matterapi.models.StatusOK

Adds members to a custom group

Adds members to a custom group.

Permissions:

Must have custom_group_manage_members permission for the given group.

Minimum Server Version:

6.3

Api Reference:

AddGroupMembers

async create_group(*, json_body: Union[matterapi.models.CreateGroupJsonBody, Dict]) None

Create a custom group

Create a custom type group.

#### Permission Must have create_custom_group permission.

Minimum Server Version:

6.3

Api Reference:

CreateGroup

async delete_group(group_id: str) matterapi.models.StatusOK

Deletes a custom group

Soft deletes a custom group.

Permissions:

Must have custom_group_delete permission for the given group.

Minimum Server Version:

6.3

Api Reference:

DeleteGroup

async delete_group_members(group_id: str, *, json_body: Union[matterapi.models.DeleteGroupMembersJsonBody, Dict]) matterapi.models.StatusOK

Removes members from a custom group

Soft deletes a custom group members.

Permissions:

Must have custom_group_manage_members permission for the given group.

Minimum Server Version:

6.3

Api Reference:

DeleteGroupMembers

async get_group(group_id: str) matterapi.models.Group

Get a group

Get group from the provided group id string

Permissions:

Must have manage_system permission.

Minimum Server Version:

5.11

Api Reference:

GetGroup

async get_group_stats(group_id: str) matterapi.models.GetGroupStatsResponse200

Get group stats

Retrieve the stats of a given group.

Permissions:

Must have manage_system permission.

Minimum Server Version:

5.26

Api Reference:

GetGroupStats

async get_group_syncable_for_channel_id(group_id: str, channel_id: str) matterapi.models.GroupSyncableChannel

Get GroupSyncable from channel ID

Get the GroupSyncable object with group_id and channel_id from params

Permissions:

Must have manage_system permission.

Minimum Server Version:

5.11

Api Reference:

GetGroupSyncableForChannelId

async get_group_syncable_for_team_id(group_id: str, team_id: str) matterapi.models.GroupSyncableTeam

Get GroupSyncable from Team ID

Get the GroupSyncable object with group_id and team_id from params

Permissions:

Must have manage_system permission.

Minimum Server Version:

5.11

Api Reference:

GetGroupSyncableForTeamId

async get_group_syncables_channels(group_id: str) List[matterapi.models.GroupSyncableChannels]

Get group channels

Retrieve the list of channels associated to the group

Permissions:

Must have manage_system permission.

Minimum Server Version:

5.11

Api Reference:

GetGroupSyncablesChannels

async get_group_syncables_teams(group_id: str) List[matterapi.models.GroupSyncableTeams]

Get group teams

Retrieve the list of teams associated to the group

Permissions:

Must have manage_system permission.

Minimum Server Version:

5.11

Api Reference:

GetGroupSyncablesTeams

async get_group_users(group_id: str, *, page: Optional[int] = 0, per_page: Optional[int] = 60) matterapi.models.GetGroupUsersResponse200

Get group users

Retrieve the list of users associated with a given group.

Permissions:

Must have manage_system permission.

Minimum Server Version:

5.11

Api Reference:

GetGroupUsers

async get_groups(*, page: Optional[int] = 0, per_page: Optional[int] = 60, q: Optional[str] = None, include_member_count: Optional[bool] = None, not_associated_to_team: str, not_associated_to_channel: str, since: Optional[int] = None, filter_allow_reference: Optional[bool] = False) List[matterapi.models.Group]

Get groups

Retrieve a list of all groups not associated to a particular channel or team.

not_associated_to_team OR not_associated_to_channel is required.

If you use not_associated_to_team, you must be a team admin for that particular team (permission to manage that team).

If you use not_associated_to_channel, you must be a channel admin for that particular channel (permission to manage that channel).

Minimum Server Version:

5.11

Api Reference:

GetGroups

async get_groups_associated_to_channels_by_team(team_id: str, *, page: Optional[int] = 0, per_page: Optional[int] = 60, filter_allow_reference: Optional[bool] = False, paginate: Optional[bool] = False) matterapi.models.GetGroupsAssociatedToChannelsByTeamResponse200

Get team groups by channels

Retrieve the set of groups associated with the channels in the given team grouped by channel.

Permissions:

Must have manage_system permission or can access only for current user

Minimum Server Version:

5.11

Api Reference:

GetGroupsAssociatedToChannelsByTeam

async get_groups_by_channel(channel_id: str, *, page: Optional[int] = 0, per_page: Optional[int] = 60, filter_allow_reference: Optional[bool] = False) List[matterapi.models.Group]

Get channel groups

Retrieve the list of groups associated with a given channel.

Permissions:

Must have manage_system permission.

Minimum Server Version:

5.11

Api Reference:

GetGroupsByChannel

async get_groups_by_team(team_id: str, *, page: Optional[int] = 0, per_page: Optional[int] = 60, filter_allow_reference: Optional[bool] = False) List[matterapi.models.Group]

Get team groups

Retrieve the list of groups associated with a given team.

Minimum Server Version:

5.11

Api Reference:

GetGroupsByTeam

async get_groups_by_user_id(user_id: str) List[matterapi.models.Group]

Get groups for a userId

Retrieve the list of groups associated to the user

Minimum Server Version:

5.24

Api Reference:

GetGroupsByUserId

Link a channel to a group

Link a channel to a group Otherwise, you must have the manage_public_channel_members permission.

Permissions:

If the channel is private, you must have manage_private_channel_members permission.

Minimum Server Version:

5.11

Api Reference:

LinkGroupSyncableForChannel

Link a team to a group

Link a team to a group

Permissions:

Must have manage_team permission.

Minimum Server Version:

5.11

Api Reference:

LinkGroupSyncableForTeam

async patch_group(group_id: str, *, json_body: Union[matterapi.models.PatchGroupJsonBody, Dict]) matterapi.models.Group

Patch a group

Partially update a group by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.

Permissions:

Must have manage_system permission.

Minimum Server Version:

5.11

Api Reference:

PatchGroup

async patch_group_syncable_for_channel(group_id: str, channel_id: str, *, json_body: Union[matterapi.models.PatchGroupSyncableForChannelJsonBody, Dict]) matterapi.models.GroupSyncableChannel

Patch a GroupSyncable associated to Channel

Partially update a GroupSyncable by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.

Permissions:

Must have manage_system permission.

Minimum Server Version:

5.11

Api Reference:

PatchGroupSyncableForChannel

async patch_group_syncable_for_team(group_id: str, team_id: str, *, json_body: Union[matterapi.models.PatchGroupSyncableForTeamJsonBody, Dict]) matterapi.models.GroupSyncableTeam

Patch a GroupSyncable associated to Team

Partially update a GroupSyncable by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.

Permissions:

Must have manage_system permission.

Minimum Server Version:

5.11

Api Reference:

PatchGroupSyncableForTeam

Delete a link from a channel to a group

Delete a link from a channel to a group Otherwise, you must have the manage_public_channel_members permission.

Permissions:

If the channel is private, you must have manage_private_channel_members permission.

Minimum Server Version:

5.11

Api Reference:

UnlinkGroupSyncableForChannel

Delete a link from a team to a group

Delete a link from a team to a group

Permissions:

Must have manage_team permission.

Minimum Server Version:

5.11

Api Reference:

UnlinkGroupSyncableForTeam

Delete a link for LDAP group

Permissions:

Must have manage_system permission.

Minimum Server Version:

5.11

Api Reference:

UnlinkLdapGroup