0
# Task Management
1
2
Task and to-do management system for organizing work items with priority levels, due dates, assignments, status tracking, and integration with accounts, contacts, and other CRM entities.
3
4
## Capabilities
5
6
### Task Listing and Search
7
8
List and search tasks with comprehensive filtering options.
9
10
```python { .api }
11
def list_tasks(title: str = None, status: str = None, priority: str = None,
12
assigned_to: str = None, account: str = None, due_date: str = None,
13
limit: int = 10, offset: int = 0) -> dict:
14
"""
15
List tasks with filtering and search.
16
17
Args:
18
title (str, optional): Filter by task title (partial match)
19
status (str, optional): Filter by status ('New', 'In Progress', 'Completed')
20
priority (str, optional): Filter by priority ('Low', 'Normal', 'High', 'Urgent')
21
assigned_to (str, optional): Filter by assigned user UUID
22
account (str, optional): Filter by associated account UUID
23
due_date (str, optional): Filter by due date (YYYY-MM-DD)
24
limit (int): Number of results per page (default: 10)
25
offset (int): Number of results to skip (default: 0)
26
27
Returns:
28
dict: Paginated tasks with metadata
29
30
Headers Required:
31
Authorization: Bearer <access_token>
32
organization-id: <org_uuid>
33
34
Example:
35
GET /api/tasks/?status=In%20Progress&priority=High&limit=5
36
37
Response:
38
{
39
"count": 15,
40
"next": "/api/tasks/?limit=5&offset=5",
41
"previous": null,
42
"results": [
43
{
44
"id": "task-uuid",
45
"title": "Follow up on proposal",
46
"status": "In Progress",
47
"priority": "High",
48
"due_date": "2023-02-15",
49
"account": "account-uuid",
50
"contacts": ["contact1-uuid", "contact2-uuid"],
51
"created_on": "2023-01-15T10:30:00Z",
52
"assigned_to": ["user1-uuid"],
53
"teams": ["team1-uuid"]
54
}
55
]
56
}
57
"""
58
```
59
60
### Task Creation
61
62
Create new tasks with priority, due dates, and entity associations.
63
64
```python { .api }
65
def create_task(task_data: dict) -> dict:
66
"""
67
Create a new task.
68
69
Args:
70
task_data (dict): Task information and associations
71
72
Returns:
73
dict: Created task details
74
75
Headers Required:
76
Authorization: Bearer <access_token>
77
organization-id: <org_uuid>
78
Content-Type: multipart/form-data (if including attachments)
79
80
Example:
81
POST /api/tasks/
82
{
83
"title": "Review contract proposal",
84
"status": "New",
85
"priority": "High",
86
"due_date": "2023-02-20",
87
"account": "account-uuid",
88
"contacts": ["contact1-uuid"],
89
"assigned_to": ["user1-uuid"],
90
"teams": ["team1-uuid"]
91
}
92
93
Response:
94
{
95
"id": "new-task-uuid",
96
"title": "Review contract proposal",
97
"status": "New",
98
"priority": "High",
99
"due_date": "2023-02-20",
100
...task details...
101
}
102
"""
103
```
104
105
### Task Details and Operations
106
107
Get comprehensive task information and perform updates.
108
109
```python { .api }
110
def get_task(pk: str) -> dict:
111
"""
112
Get detailed task information.
113
114
Args:
115
pk (str): Task UUID
116
117
Returns:
118
dict: Complete task details with related entities
119
120
Headers Required:
121
Authorization: Bearer <access_token>
122
organization-id: <org_uuid>
123
124
Example:
125
GET /api/tasks/task-uuid/
126
127
Response:
128
{
129
"task_obj": {
130
"id": "task-uuid",
131
"title": "Follow up on proposal",
132
"status": "In Progress",
133
"priority": "High",
134
"due_date": "2023-02-15",
135
"account": "account-uuid",
136
"contacts": ["contact1-uuid"],
137
"created_on": "2023-01-15T10:30:00Z",
138
"created_by": "user-uuid"
139
},
140
"assigned_to": [...assigned users...],
141
"teams": [...assigned teams...],
142
"comments": [...task comments...],
143
"attachments": [...task attachments...],
144
"users_mention": [...users for @mentions...]
145
}
146
"""
147
148
def update_task(pk: str, task_data: dict) -> dict:
149
"""
150
Update task information.
151
152
Args:
153
pk (str): Task UUID
154
task_data (dict): Updated task information
155
156
Returns:
157
dict: Updated task details
158
159
Headers Required:
160
Authorization: Bearer <access_token>
161
organization-id: <org_uuid>
162
163
Example:
164
PUT /api/tasks/task-uuid/
165
{
166
"title": "Review contract proposal - URGENT",
167
"status": "In Progress",
168
"priority": "Urgent",
169
"due_date": "2023-02-10"
170
}
171
"""
172
173
def delete_task(pk: str) -> None:
174
"""
175
Delete a task.
176
177
Args:
178
pk (str): Task UUID
179
180
Returns:
181
None: 204 No Content on success
182
183
Headers Required:
184
Authorization: Bearer <access_token>
185
organization-id: <org_uuid>
186
187
Example:
188
DELETE /api/tasks/task-uuid/
189
"""
190
```
191
192
### Task Comments and Attachments
193
194
Manage comments and file attachments for tasks.
195
196
```python { .api }
197
def add_task_comment_or_attachment(pk: str, comment: str = None,
198
attachment: file = None) -> dict:
199
"""
200
Add comment or attachment to task.
201
202
Args:
203
pk (str): Task UUID
204
comment (str, optional): Comment text
205
attachment (file, optional): File to attach
206
207
Returns:
208
dict: Success response
209
210
Headers Required:
211
Authorization: Bearer <access_token>
212
organization-id: <org_uuid>
213
Content-Type: multipart/form-data (for attachments)
214
215
Example:
216
POST /api/tasks/task-uuid/
217
{
218
"comment": "Task completed successfully, proposal approved"
219
}
220
"""
221
222
def edit_task_comment(pk: str, comment: str) -> dict:
223
"""
224
Edit a task comment.
225
226
Args:
227
pk (str): Comment UUID
228
comment (str): Updated comment text
229
230
Returns:
231
dict: Updated comment
232
233
Headers Required:
234
Authorization: Bearer <access_token>
235
236
Example:
237
PUT /api/tasks/comment/comment-uuid/
238
{
239
"comment": "Updated status - awaiting final review"
240
}
241
"""
242
243
def delete_task_comment(pk: str) -> None:
244
"""
245
Delete a task comment.
246
247
Args:
248
pk (str): Comment UUID
249
250
Returns:
251
None: 204 No Content on success
252
253
Headers Required:
254
Authorization: Bearer <access_token>
255
256
Example:
257
DELETE /api/tasks/comment/comment-uuid/
258
"""
259
260
def delete_task_attachment(pk: str) -> None:
261
"""
262
Delete a task attachment.
263
264
Args:
265
pk (str): Attachment UUID
266
267
Returns:
268
None: 204 No Content on success
269
270
Headers Required:
271
Authorization: Bearer <access_token>
272
273
Example:
274
DELETE /api/tasks/attachment/attachment-uuid/
275
"""
276
```
277
278
## Task Data Types
279
280
```python { .api }
281
class Task:
282
"""Task model representing work items and to-dos"""
283
id: str # UUID
284
title: str # Required task title
285
status: str # 'New', 'In Progress', 'Completed'
286
priority: str # 'Low', 'Normal', 'High', 'Urgent'
287
due_date: date # Due date for task completion
288
289
# Entity associations
290
account: str # Account UUID (optional)
291
contacts: list[str] # Contact UUIDs
292
293
# Metadata
294
created_on: datetime
295
created_by: str # User UUID
296
org: str # Organization UUID
297
298
# Assignments
299
assigned_to: list[str] # User UUIDs
300
teams: list[str] # Team UUIDs
301
302
class TaskComment:
303
"""Comments on tasks"""
304
id: str # UUID
305
comment: str
306
task: str # Task UUID
307
commented_on: datetime
308
commented_by: str # User UUID
309
310
class TaskAttachment:
311
"""File attachments on tasks"""
312
id: str # UUID
313
attachment: str # File path/URL
314
task: str # Task UUID
315
created_on: datetime
316
created_by: str # User UUID
317
```
318
319
## Task Status Management
320
321
Tasks follow a standard workflow with these status options:
322
323
- **New**: Newly created task, not yet started
324
- **In Progress**: Task is actively being worked on
325
- **Completed**: Task has been finished successfully
326
327
Priority levels help organize task importance:
328
329
- **Low**: Non-urgent tasks that can be handled when time permits
330
- **Normal**: Standard priority tasks for regular workflow
331
- **High**: Important tasks that need attention soon
332
- **Urgent**: Critical tasks requiring immediate action
333
334
## Search and Filtering
335
336
Tasks support multiple search and filter options:
337
338
- **Title Search**: `title` parameter for partial text matching
339
- **Status Filter**: Filter by current task status
340
- **Priority Filter**: Filter by task priority level
341
- **Assignment**: `assigned_to` filtering by user UUID
342
- **Account Association**: Filter tasks related to specific accounts
343
- **Due Date**: Filter by due date for deadline management
344
345
All text-based filters support partial matching and are case-insensitive.
346
347
## Related Entities
348
349
Tasks can be associated with and relate to:
350
- **Accounts**: Tasks can be linked to customer accounts
351
- **Contacts**: Associate tasks with specific individuals
352
- **Teams**: Assign tasks to teams for collaborative work
353
- **Users**: Individual task assignments and ownership
354
- **Comments**: Task progress updates and communication
355
- **Attachments**: Supporting documents and files
356
357
This makes tasks central to workflow management and activity tracking across the CRM system.