0
# Private Groups
1
2
Private group management with enhanced privacy controls and restricted access. Provides similar functionality to public channels but with additional privacy and membership restrictions.
3
4
## Capabilities
5
6
### Group Creation and Management
7
8
```python { .api }
9
def groups_create(self, name, **kwargs):
10
"""
11
Create a new private group.
12
13
Parameters:
14
- name (str): Group name
15
- members (list, optional): Initial members list
16
- readonly (bool, optional): Create as read-only
17
- customFields (dict, optional): Custom fields
18
19
Returns:
20
requests.Response: Group creation result
21
"""
22
23
def groups_info(self, room_id=None, room_name=None, **kwargs):
24
"""
25
Get private group information.
26
27
Parameters:
28
- room_id (str, optional): Group ID
29
- room_name (str, optional): Group name
30
31
Returns:
32
requests.Response: Group information
33
"""
34
35
def groups_delete(self, room_id=None, group=None, **kwargs):
36
"""
37
Delete a private group.
38
39
Parameters:
40
- room_id (str, optional): Group ID
41
- group (str, optional): Group name
42
43
Returns:
44
requests.Response: Deletion result
45
"""
46
```
47
48
### Group Listing and Access
49
50
```python { .api }
51
def groups_list(self, **kwargs):
52
"""
53
List private groups user is part of.
54
55
Parameters:
56
- offset (int, optional): Number of items to skip
57
- count (int, optional): Number of items to return
58
59
Returns:
60
requests.Response: List of groups
61
"""
62
63
def groups_list_all(self, **kwargs):
64
"""
65
List all private groups (admin only).
66
67
Parameters:
68
- offset (int, optional): Number of items to skip
69
- count (int, optional): Number of items to return
70
71
Returns:
72
requests.Response: List of all groups
73
"""
74
```
75
76
### Membership Management
77
78
```python { .api }
79
def groups_invite(self, room_id, user_id, **kwargs):
80
"""
81
Invite user to private group.
82
83
Parameters:
84
- room_id (str): Group ID
85
- user_id (str): User ID to invite
86
87
Returns:
88
requests.Response: Invitation result
89
"""
90
91
def groups_kick(self, room_id, user_id, **kwargs):
92
"""
93
Remove user from private group.
94
95
Parameters:
96
- room_id (str): Group ID
97
- user_id (str): User ID to remove
98
99
Returns:
100
requests.Response: Removal result
101
"""
102
103
def groups_leave(self, room_id, **kwargs):
104
"""
105
Leave private group.
106
107
Parameters:
108
- room_id (str): Group ID
109
110
Returns:
111
requests.Response: Leave result
112
"""
113
114
def groups_members(self, room_id=None, group=None, **kwargs):
115
"""
116
List group members.
117
118
Parameters:
119
- room_id (str, optional): Group ID
120
- group (str, optional): Group name
121
122
Returns:
123
requests.Response: List of members
124
"""
125
```
126
127
### Group Configuration
128
129
```python { .api }
130
def groups_rename(self, room_id, name, **kwargs):
131
"""
132
Rename private group.
133
134
Parameters:
135
- room_id (str): Group ID
136
- name (str): New name
137
138
Returns:
139
requests.Response: Rename result
140
"""
141
142
def groups_set_description(self, room_id, description, **kwargs):
143
"""
144
Set group description.
145
146
Parameters:
147
- room_id (str): Group ID
148
- description (str): Description text
149
150
Returns:
151
requests.Response: Update result
152
"""
153
154
def groups_set_topic(self, room_id, topic, **kwargs):
155
"""
156
Set group topic.
157
158
Parameters:
159
- room_id (str): Group ID
160
- topic (str): Topic text
161
162
Returns:
163
requests.Response: Update result
164
"""
165
166
def groups_set_read_only(self, room_id, read_only, **kwargs):
167
"""
168
Set group read-only status.
169
170
Parameters:
171
- room_id (str): Group ID
172
- read_only (bool): Read-only status
173
174
Returns:
175
requests.Response: Update result
176
"""
177
```
178
179
### Role Management
180
181
```python { .api }
182
def groups_add_moderator(self, room_id, user_id, **kwargs):
183
"""
184
Add group moderator.
185
186
Parameters:
187
- room_id (str): Group ID
188
- user_id (str): User ID
189
190
Returns:
191
requests.Response: Role assignment result
192
"""
193
194
def groups_add_owner(self, room_id, user_id, **kwargs):
195
"""
196
Add group owner.
197
198
Parameters:
199
- room_id (str): Group ID
200
- user_id (str): User ID
201
202
Returns:
203
requests.Response: Role assignment result
204
"""
205
206
def groups_add_leader(self, room_id, user_id, **kwargs):
207
"""
208
Add group leader.
209
210
Parameters:
211
- room_id (str): Group ID
212
- user_id (str): User ID
213
214
Returns:
215
requests.Response: Role assignment result
216
"""
217
```