CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-django-crm

Open Source CRM developed on Django framework with REST API for contact, lead, account, and opportunity management

Overview
Eval results
Files

teams.mddocs/

Team Management

Team creation and management system for organizing users into collaborative groups, enabling team-based assignments and permissions across all CRM entities.

Capabilities

Team Listing and Search

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"
                }
            ]
        }
    """

Team Creation

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"
        }
    """

Team Details and Operations

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/
    """

Team Data Types

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: bool

Team Management Features

Team Membership

Teams allow you to organize users into logical groups based on:

  • Department: Sales, Marketing, Support, etc.
  • Project: Specific project or client teams
  • Role: Management teams, specialist groups
  • Location: Regional or office-based teams

Team-Based Assignments

Teams enable collective assignments across CRM entities:

  • Accounts: Assign entire teams to manage customer accounts
  • Contacts: Team access to contact information
  • Leads: Distribute leads among team members
  • Opportunities: Collaborative sales opportunity management
  • Tasks: Team task assignment and collaboration
  • Events: Team meetings and calendar events
  • Cases: Support team case management

Permission Management

Teams can be used for:

  • Access Control: Restrict data access to team members
  • Notification Management: Team-based alerts and updates
  • Reporting: Generate team-based performance reports
  • Workflow: Route work items to appropriate teams

Search and Filtering

Teams support basic search and filter options:

  • Name Search: name parameter for partial text matching of team names
  • Organization Scoping: All teams are automatically filtered by organization

Text-based filters support partial matching and are case-insensitive.

Related Entities

Teams can be associated with and used across:

  • Users: Team membership and user organization
  • Accounts: Team-based account management
  • Contacts: Team access to contact information
  • Leads: Team assignments for lead management
  • Opportunities: Collaborative opportunity tracking
  • Tasks: Team task assignments and collaboration
  • Events: Team calendar events and meetings
  • Cases: Support team case assignments

This makes teams central to organizational structure and collaborative work management across the CRM system.

Best Practices

Team Structure

  • Keep team sizes manageable (typically 5-15 members)
  • Create teams based on clear business functions or projects
  • Use descriptive names and descriptions for easy identification

Team Management

  • Regularly review and update team membership
  • Assign team leadership roles when appropriate
  • Use teams consistently across all CRM entity assignments

Access Patterns

  • Assign entities to teams rather than individuals when possible
  • Use teams for bulk operations and reporting
  • Leverage team-based filtering for focused views of data

Install with Tessl CLI

npx tessl i tessl/pypi-django-crm

docs

accounts.md

authentication.md

cases.md

contacts.md

documents.md

events.md

index.md

invoices.md

leads.md

opportunities.md

tasks.md

teams.md

tile.json