Teams API
Endpoints for managing teams, team membership, and viewing the user's own teams.
List All Teams
GET /teams?search={search}&status={status}&department={department}
Query Parameters:
search(optional): Free-text searchstatus(optional): Filter by team statusdepartment(optional): Filter by department ID
Response: 200 OK with list of teams.
Create or Update Team
POST /teams
Request Body:
{
"id": 5,
"name": "Backend Engineering",
"description": "Backend services team",
"department": 2,
"status": "Active"
}
Omit id to create a new team.
Response: 200 OK
Get Team Details
GET /teams/{id}
Response: 200 OK
Delete Team
DELETE /teams/{id}
Response: 200 OK
Get Team Members
GET /teams/{id}/members
Response: 200 OK with the list of members.
Bulk Add Team Members
Adds multiple employees to a team in a single request.
POST /teams/{id}/members/bulk
Request Body:
{
"employee_ids": [3, 5, 8, 12]
}
Response: 200 OK
List All Team Members
GET /team-members
Response: 200 OK
Add Team Member
POST /team-members
Request Body:
{
"team": 5,
"employee": 8,
"role": "Member"
}
Response: 200 OK
Remove Team Member
DELETE /team-members/{id}
Response: 200 OK
Get Employees for Team Assignment
Returns the list of active employees available for team membership.
GET /teams/employees
Get Departments
GET /teams/departments
Get Team Statistics
GET /teams/stats
My Teams
Endpoints for teams the current user belongs to.
Get My Teams
GET /my-teams
Get My Team Details
GET /my-teams/{id}
Get My Team Members
GET /my-teams/{id}/members
Get My Team Stats
GET /my-teams/stats
Get Teammates' Upcoming Leaves
GET /my-teams/leaves
Get Teammates' Today Attendance
GET /my-teams/attendance