Open Source CRM developed on Django framework with REST API for contact, lead, account, and opportunity management
Team creation and management system for organizing users into collaborative groups, enabling team-based assignments and permissions across all CRM entities.
List and search teams within your organization.
def list_teams(name: str = None, limit: int = 10, offset: int = 0) -> dict:
"""
List organization teams with filtering.
Args:
name (str, optional): Filter by team name (partial match)
limit (int): Number of results per page (default: 10)
offset (int): Number of results to skip (default: 0)
Returns:
dict: Paginated teams with metadata
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
GET /api/teams/?name=sales&limit=5
Response:
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"id": "team-uuid",
"name": "Sales Team",
"description": "Primary sales and business development team",
"org": "org-uuid",
"users": [
{
"id": "user1-uuid",
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@company.com",
"role": "USER"
},
{
"id": "user2-uuid",
"first_name": "Jane",
"last_name": "Doe",
"email": "jane.doe@company.com",
"role": "ADMIN"
}
],
"created_on": "2023-01-15T10:30:00Z"
}
]
}
"""Create new teams and organize users into collaborative groups.
def create_team(team_data: dict) -> dict:
"""
Create a new team.
Args:
team_data (dict): Team information and user assignments
Returns:
dict: Created team details
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
POST /api/teams/
{
"name": "Customer Success Team",
"description": "Team focused on customer onboarding and success",
"users": ["user1-uuid", "user2-uuid", "user3-uuid"]
}
Response:
{
"id": "new-team-uuid",
"name": "Customer Success Team",
"description": "Team focused on customer onboarding and success",
"org": "org-uuid",
"users": [
{
"id": "user1-uuid",
"first_name": "Alice",
"last_name": "Johnson",
"email": "alice.johnson@company.com",
"role": "USER"
}
],
"created_on": "2023-02-01T14:20:00Z"
}
"""Get comprehensive team information and perform updates.
def get_team(pk: str) -> dict:
"""
Get detailed team information.
Args:
pk (str): Team UUID
Returns:
dict: Complete team details with member information
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
GET /api/teams/team-uuid/
Response:
{
"team_obj": {
"id": "team-uuid",
"name": "Sales Team",
"description": "Primary sales and business development team",
"org": "org-uuid",
"created_on": "2023-01-15T10:30:00Z"
},
"users": [
{
"id": "user1-uuid",
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@company.com",
"role": "USER",
"phone": "+1234567890",
"is_active": true
},
{
"id": "user2-uuid",
"first_name": "Jane",
"last_name": "Doe",
"email": "jane.doe@company.com",
"role": "ADMIN",
"phone": "+1987654321",
"is_active": true
}
]
}
"""
def update_team(pk: str, team_data: dict) -> dict:
"""
Update team information and membership.
Args:
pk (str): Team UUID
team_data (dict): Updated team information
Returns:
dict: Updated team details
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
PUT /api/teams/team-uuid/
{
"name": "Senior Sales Team",
"description": "Senior sales team for enterprise accounts",
"users": ["user1-uuid", "user3-uuid", "user4-uuid"]
}
"""
def delete_team(pk: str) -> None:
"""
Delete a team.
Args:
pk (str): Team UUID
Returns:
None: 204 No Content on success
Headers Required:
Authorization: Bearer <access_token>
organization-id: <org_uuid>
Example:
DELETE /api/teams/team-uuid/
"""class Team:
"""Team model for organizing users into collaborative groups"""
id: str # UUID
name: str # Required team name
description: str # Optional team description
# Organization association
org: str # Organization UUID
# Team membership
users: list[User] # List of team member user objects
# Metadata
created_on: datetime
class TeamMember:
"""Team member information (User details in team context)"""
id: str # User UUID
first_name: str
last_name: str
email: str
role: str # 'ADMIN' or 'USER'
phone: str
is_active: boolTeams allow you to organize users into logical groups based on:
Teams enable collective assignments across CRM entities:
Teams can be used for:
Teams support basic search and filter options:
name parameter for partial text matching of team namesText-based filters support partial matching and are case-insensitive.
Teams can be associated with and used across:
This makes teams central to organizational structure and collaborative work management across the CRM system.
Install with Tessl CLI
npx tessl i tessl/pypi-django-crm