Open Source CRM developed on Django framework with REST API for contact, lead, account, and opportunity management
Support case tracking and management system with priority levels, case types, status management, resolution tracking, and integration with accounts and contacts for comprehensive customer support.
List and search cases with comprehensive filtering options.
def list_cases(name: str = None, status: str = None, priority: str = None,
case_type: str = None, assigned_to: str = None, account: str = None,
limit: int = 10, offset: int = 0) -> dict:
"""
List cases with filtering and search.
Args:
name (str, optional): Filter by case name (partial match)
status (str, optional): Filter by status ('New', 'In Progress', 'On Hold', 'Closed')
priority (str, optional): Filter by priority level
case_type (str, optional): Filter by case type
assigned_to (str, optional): Filter by assigned user UUID
account (str, optional): Filter by associated account UUID
limit (int): Number of results per page (default: 10)
offset (int): Number of results to skip (default: 0)
Returns:
dict: Paginated cases with metadata
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
GET /api/cases/?status=In%20Progress&priority=High&limit=5
Response:
{
"count": 8,
"next": "/api/cases/?limit=5&offset=5",
"previous": null,
"results": [
{
"id": "case-uuid",
"name": "Login Issues - ACME Corp",
"status": "In Progress",
"priority": "High",
"case_type": "Technical",
"account": "account-uuid",
"contacts": ["contact1-uuid"],
"created_on": "2023-01-15T10:30:00Z",
"closed_on": null,
"assigned_to": ["user1-uuid"],
"teams": ["team1-uuid"]
}
]
}
"""Create new support cases with priority, type, and entity associations.
def create_case(case_data: dict) -> dict:
"""
Create a new support case.
Args:
case_data (dict): Case information and associations
Returns:
dict: Created case details
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Content-Type: multipart/form-data (if including attachments)
Example:
POST /api/cases/
{
"name": "Email Configuration Problem",
"status": "New",
"priority": "Normal",
"case_type": "Technical",
"account": "account-uuid",
"contacts": ["contact1-uuid"],
"assigned_to": ["user1-uuid"],
"teams": ["support-team-uuid"]
}
Response:
{
"id": "new-case-uuid",
"name": "Email Configuration Problem",
"status": "New",
"priority": "Normal",
"case_type": "Technical",
"created_on": "2023-02-01T09:00:00Z",
...case details...
}
"""Get comprehensive case information and perform updates.
def get_case(pk: str) -> dict:
"""
Get detailed case information.
Args:
pk (str): Case UUID
Returns:
dict: Complete case details with related entities
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
GET /api/cases/case-uuid/
Response:
{
"case_obj": {
"id": "case-uuid",
"name": "Login Issues - ACME Corp",
"status": "In Progress",
"priority": "High",
"case_type": "Technical",
"account": "account-uuid",
"contacts": ["contact1-uuid"],
"created_on": "2023-01-15T10:30:00Z",
"closed_on": null,
"created_by": "user-uuid"
},
"assigned_to": [...assigned users...],
"teams": [...assigned teams...],
"comments": [...case comments...],
"attachments": [...case attachments...],
"users_mention": [...users for @mentions...]
}
"""
def update_case(pk: str, case_data: dict) -> dict:
"""
Update case information.
Args:
pk (str): Case UUID
case_data (dict): Updated case information
Returns:
dict: Updated case details
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
PUT /api/cases/case-uuid/
{
"name": "Login Issues - RESOLVED",
"status": "Closed",
"closed_on": "2023-02-05T16:30:00Z"
}
"""
def delete_case(pk: str) -> None:
"""
Delete a case.
Args:
pk (str): Case UUID
Returns:
None: 204 No Content on success
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
DELETE /api/cases/case-uuid/
"""Manage comments and file attachments for cases.
def add_case_comment_or_attachment(pk: str, comment: str = None,
attachment: file = None) -> dict:
"""
Add comment or attachment to case.
Args:
pk (str): Case UUID
comment (str, optional): Comment text
attachment (file, optional): File to attach
Returns:
dict: Success response
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Content-Type: multipart/form-data (for attachments)
Example:
POST /api/cases/case-uuid/
{
"comment": "Issue reproduced, working on solution"
}
"""
def edit_case_comment(pk: str, comment: str) -> dict:
"""
Edit a case comment.
Args:
pk (str): Comment UUID
comment (str): Updated comment text
Returns:
dict: Updated comment
Headers Required:
Authorization: Bearer <access_token>
Example:
PUT /api/cases/comment/comment-uuid/
{
"comment": "Root cause identified - server configuration issue"
}
"""
def delete_case_comment(pk: str) -> None:
"""
Delete a case comment.
Args:
pk (str): Comment UUID
Returns:
None: 204 No Content on success
Headers Required:
Authorization: Bearer <access_token>
Example:
DELETE /api/cases/comment/comment-uuid/
"""
def delete_case_attachment(pk: str) -> None:
"""
Delete a case attachment.
Args:
pk (str): Attachment UUID
Returns:
None: 204 No Content on success
Headers Required:
Authorization: Bearer <access_token>
Example:
DELETE /api/cases/attachment/attachment-uuid/
"""class Case:
"""Case model representing support cases and issues"""
id: str # UUID
name: str # Required case title/description
status: str # 'New', 'In Progress', 'On Hold', 'Closed'
priority: str # Priority level (e.g., 'Low', 'Normal', 'High', 'Critical')
case_type: str # Type of case (e.g., 'Technical', 'Billing', 'General')
# Entity associations
account: str # Account UUID (optional)
contacts: list[str] # Contact UUIDs
# Resolution tracking
closed_on: datetime # When case was closed (if applicable)
# Metadata
created_on: datetime
created_by: str # User UUID
org: str # Organization UUID
# Assignments
assigned_to: list[str] # User UUIDs
teams: list[str] # Team UUIDs
class CaseComment:
"""Comments on cases"""
id: str # UUID
comment: str
case: str # Case UUID
commented_on: datetime
commented_by: str # User UUID
class CaseAttachment:
"""File attachments on cases"""
id: str # UUID
attachment: str # File path/URL
case: str # Case UUID
created_on: datetime
created_by: str # User UUIDCases follow a standard support workflow with these status options:
Priority helps organize case urgency and response times:
Cases can be categorized by type for better organization:
Cases support multiple search and filter options:
name parameter for partial text matchingassigned_to filtering by user UUIDAll text-based filters support partial matching and are case-insensitive.
Cases can be associated with and relate to:
This makes cases central to customer support management and issue resolution tracking across the CRM system.
Install with Tessl CLI
npx tessl i tessl/pypi-django-crm