0
# Team Management
1
2
Team creation and management system for organizing users into collaborative groups, enabling team-based assignments and permissions across all CRM entities.
3
4
## Capabilities
5
6
### Team Listing and Search
7
8
List and search teams within your organization.
9
10
```python { .api }
11
def list_teams(name: str = None, limit: int = 10, offset: int = 0) -> dict:
12
"""
13
List organization teams with filtering.
14
15
Args:
16
name (str, optional): Filter by team name (partial match)
17
limit (int): Number of results per page (default: 10)
18
offset (int): Number of results to skip (default: 0)
19
20
Returns:
21
dict: Paginated teams with metadata
22
23
Headers Required:
24
Authorization: Bearer <access_token>
25
organization-id: <org_uuid>
26
27
Example:
28
GET /api/teams/?name=sales&limit=5
29
30
Response:
31
{
32
"count": 3,
33
"next": null,
34
"previous": null,
35
"results": [
36
{
37
"id": "team-uuid",
38
"name": "Sales Team",
39
"description": "Primary sales and business development team",
40
"org": "org-uuid",
41
"users": [
42
{
43
"id": "user1-uuid",
44
"first_name": "John",
45
"last_name": "Smith",
46
"email": "john.smith@company.com",
47
"role": "USER"
48
},
49
{
50
"id": "user2-uuid",
51
"first_name": "Jane",
52
"last_name": "Doe",
53
"email": "jane.doe@company.com",
54
"role": "ADMIN"
55
}
56
],
57
"created_on": "2023-01-15T10:30:00Z"
58
}
59
]
60
}
61
"""
62
```
63
64
### Team Creation
65
66
Create new teams and organize users into collaborative groups.
67
68
```python { .api }
69
def create_team(team_data: dict) -> dict:
70
"""
71
Create a new team.
72
73
Args:
74
team_data (dict): Team information and user assignments
75
76
Returns:
77
dict: Created team details
78
79
Headers Required:
80
Authorization: Bearer <access_token>
81
organization-id: <org_uuid>
82
83
Example:
84
POST /api/teams/
85
{
86
"name": "Customer Success Team",
87
"description": "Team focused on customer onboarding and success",
88
"users": ["user1-uuid", "user2-uuid", "user3-uuid"]
89
}
90
91
Response:
92
{
93
"id": "new-team-uuid",
94
"name": "Customer Success Team",
95
"description": "Team focused on customer onboarding and success",
96
"org": "org-uuid",
97
"users": [
98
{
99
"id": "user1-uuid",
100
"first_name": "Alice",
101
"last_name": "Johnson",
102
"email": "alice.johnson@company.com",
103
"role": "USER"
104
}
105
],
106
"created_on": "2023-02-01T14:20:00Z"
107
}
108
"""
109
```
110
111
### Team Details and Operations
112
113
Get comprehensive team information and perform updates.
114
115
```python { .api }
116
def get_team(pk: str) -> dict:
117
"""
118
Get detailed team information.
119
120
Args:
121
pk (str): Team UUID
122
123
Returns:
124
dict: Complete team details with member information
125
126
Headers Required:
127
Authorization: Bearer <access_token>
128
organization-id: <org_uuid>
129
130
Example:
131
GET /api/teams/team-uuid/
132
133
Response:
134
{
135
"team_obj": {
136
"id": "team-uuid",
137
"name": "Sales Team",
138
"description": "Primary sales and business development team",
139
"org": "org-uuid",
140
"created_on": "2023-01-15T10:30:00Z"
141
},
142
"users": [
143
{
144
"id": "user1-uuid",
145
"first_name": "John",
146
"last_name": "Smith",
147
"email": "john.smith@company.com",
148
"role": "USER",
149
"phone": "+1234567890",
150
"is_active": true
151
},
152
{
153
"id": "user2-uuid",
154
"first_name": "Jane",
155
"last_name": "Doe",
156
"email": "jane.doe@company.com",
157
"role": "ADMIN",
158
"phone": "+1987654321",
159
"is_active": true
160
}
161
]
162
}
163
"""
164
165
def update_team(pk: str, team_data: dict) -> dict:
166
"""
167
Update team information and membership.
168
169
Args:
170
pk (str): Team UUID
171
team_data (dict): Updated team information
172
173
Returns:
174
dict: Updated team details
175
176
Headers Required:
177
Authorization: Bearer <access_token>
178
organization-id: <org_uuid>
179
180
Example:
181
PUT /api/teams/team-uuid/
182
{
183
"name": "Senior Sales Team",
184
"description": "Senior sales team for enterprise accounts",
185
"users": ["user1-uuid", "user3-uuid", "user4-uuid"]
186
}
187
"""
188
189
def delete_team(pk: str) -> None:
190
"""
191
Delete a team.
192
193
Args:
194
pk (str): Team UUID
195
196
Returns:
197
None: 204 No Content on success
198
199
Headers Required:
200
Authorization: Bearer <access_token>
201
organization-id: <org_uuid>
202
203
Example:
204
DELETE /api/teams/team-uuid/
205
"""
206
```
207
208
## Team Data Types
209
210
```python { .api }
211
class Team:
212
"""Team model for organizing users into collaborative groups"""
213
id: str # UUID
214
name: str # Required team name
215
description: str # Optional team description
216
217
# Organization association
218
org: str # Organization UUID
219
220
# Team membership
221
users: list[User] # List of team member user objects
222
223
# Metadata
224
created_on: datetime
225
226
class TeamMember:
227
"""Team member information (User details in team context)"""
228
id: str # User UUID
229
first_name: str
230
last_name: str
231
email: str
232
role: str # 'ADMIN' or 'USER'
233
phone: str
234
is_active: bool
235
```
236
237
## Team Management Features
238
239
### Team Membership
240
Teams allow you to organize users into logical groups based on:
241
242
- **Department**: Sales, Marketing, Support, etc.
243
- **Project**: Specific project or client teams
244
- **Role**: Management teams, specialist groups
245
- **Location**: Regional or office-based teams
246
247
### Team-Based Assignments
248
Teams enable collective assignments across CRM entities:
249
250
- **Accounts**: Assign entire teams to manage customer accounts
251
- **Contacts**: Team access to contact information
252
- **Leads**: Distribute leads among team members
253
- **Opportunities**: Collaborative sales opportunity management
254
- **Tasks**: Team task assignment and collaboration
255
- **Events**: Team meetings and calendar events
256
- **Cases**: Support team case management
257
258
### Permission Management
259
Teams can be used for:
260
261
- **Access Control**: Restrict data access to team members
262
- **Notification Management**: Team-based alerts and updates
263
- **Reporting**: Generate team-based performance reports
264
- **Workflow**: Route work items to appropriate teams
265
266
## Search and Filtering
267
268
Teams support basic search and filter options:
269
270
- **Name Search**: `name` parameter for partial text matching of team names
271
- **Organization Scoping**: All teams are automatically filtered by organization
272
273
Text-based filters support partial matching and are case-insensitive.
274
275
## Related Entities
276
277
Teams can be associated with and used across:
278
- **Users**: Team membership and user organization
279
- **Accounts**: Team-based account management
280
- **Contacts**: Team access to contact information
281
- **Leads**: Team assignments for lead management
282
- **Opportunities**: Collaborative opportunity tracking
283
- **Tasks**: Team task assignments and collaboration
284
- **Events**: Team calendar events and meetings
285
- **Cases**: Support team case assignments
286
287
This makes teams central to organizational structure and collaborative work management across the CRM system.
288
289
## Best Practices
290
291
### Team Structure
292
- Keep team sizes manageable (typically 5-15 members)
293
- Create teams based on clear business functions or projects
294
- Use descriptive names and descriptions for easy identification
295
296
### Team Management
297
- Regularly review and update team membership
298
- Assign team leadership roles when appropriate
299
- Use teams consistently across all CRM entity assignments
300
301
### Access Patterns
302
- Assign entities to teams rather than individuals when possible
303
- Use teams for bulk operations and reporting
304
- Leverage team-based filtering for focused views of data