{
  "openapi": "3.1.0",
  "info": {
    "title": "Tracker 29 API",
    "version": "v1",
    "description": "Tracker 29 provides an API-key-only integration surface (/api-v1/) for external integrations. It covers employee reads, dashboard overviews, activity, attendance, productivity, reports, teams, and projects. All calls are rate-limited per key and counted toward your plan quota.",
    "contact": {
      "name": "Azeosoft Web Technologies",
      "url": "https://azeosoft.com"
    }
  },
  "servers": [
    {
      "url": "https://api-emp-tracker.azeosoft.com/api-v1",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Health",
      "description": "Liveness check for the API v1 route surface."
    },
    {
      "name": "Employees",
      "description": "Read tracker-enrolled employees, all people, per-employee overviews, organisation users, and people stats."
    },
    {
      "name": "Tracker",
      "description": "Dashboard overviews, timeline calendar, live users, quotas, and employee settings reads."
    },
    {
      "name": "Activity",
      "description": "Read activity timelines, screenshot gallery entries, and raw activity logs for a specific employee and date."
    },
    {
      "name": "Attendance",
      "description": "Read current attendance status and historical attendance records."
    },
    {
      "name": "Reports",
      "description": "Generate and read attendance, activity, productivity, and summary reports. Export to CSV/XLSX and access report history."
    },
    {
      "name": "Productivity",
      "description": "Read productivity rules, per-employee summaries and weekly breakdowns, and organisation-wide productivity overview."
    },
    {
      "name": "Teams",
      "description": "Read team directory, stats, full team list, and team timeline data."
    },
    {
      "name": "Projects",
      "description": "Read project lists, stats, time logs, exports, and individual project details."
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "v1-health-check",
        "summary": "API v1 Health",
        "description": "Returns the liveness status of the API v1 route surface. Useful for integration health checks.",
        "tags": [
          "Health"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "API v1 is healthy",
            "content": {
              "application/json": {
                "example": {
                  "status": "ok",
                  "version": "v1",
                  "timestamp": "2026-05-22T09:00:00Z"
                }
              }
            }
          }
        }
      }
    },
    "/employees": {
      "get": {
        "operationId": "v1-tracker-employees",
        "summary": "Tracker Employees",
        "description": "Returns all employees enrolled in the Tracker service.",
        "tags": [
          "Employees"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Tracker employees returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "employeeId": "emp_001",
                      "name": "Alice Johnson",
                      "email": "alice@example.com",
                      "status": "active"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/employees/all": {
      "get": {
        "operationId": "v1-all-employees",
        "summary": "All Employees",
        "description": "Returns all people in the organisation regardless of service assignment.",
        "tags": [
          "Employees"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "All employees returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "employeeId": "emp_001",
                      "name": "Alice Johnson",
                      "department": "Engineering"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/employees/overview/{employee_id}": {
      "get": {
        "operationId": "v1-employee-overview",
        "summary": "Employee Overview",
        "description": "Returns the overview for a specific employee including attendance, productivity, and recent activity.",
        "tags": [
          "Employees"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "description": "Employee ID",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Employee overview returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "employeeId": "emp_001",
                    "name": "Alice Johnson",
                    "avgProductivityScore": 82,
                    "attendanceRate": 95,
                    "lastActive": "2026-05-22T11:44:00Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/employees/organization/users": {
      "get": {
        "operationId": "v1-org-users",
        "summary": "Organization Users",
        "description": "Returns all user accounts under the organisation.",
        "tags": [
          "Employees"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Organisation users returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "userId": "usr_001",
                      "email": "alice@example.com",
                      "role": "Employee",
                      "services": [
                        "Tracker"
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/employees/people-stats": {
      "get": {
        "operationId": "v1-people-stats",
        "summary": "People Stats",
        "description": "Returns employee and people stats cards for the organisation.",
        "tags": [
          "Employees"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "People stats returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "totalEmployees": 50,
                    "activeToday": 38,
                    "onLeave": 3,
                    "inactive": 9
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tracker/list": {
      "get": {
        "operationId": "v1-tracker-list",
        "summary": "Tracker List",
        "description": "Returns tracker dashboard list rows for the authenticated organization scope.",
        "tags": [
          "Tracker"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Preset range such as today, yesterday, thisweek, thismonth, or custom.",
            "schema": {
              "type": "string"
            },
            "example": "today"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Custom range start date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "Custom range end date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          },
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "description": "Filter rows for one employee.",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Tracker list returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "employeeId": "emp_001",
                      "name": "Alice Johnson",
                      "trackedTime": "7h 35m",
                      "activeSec": 23500,
                      "idleSec": 1800,
                      "productivityScore": 82
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tracker/summary": {
      "get": {
        "operationId": "v1-tracker-summary",
        "summary": "Tracker Summary",
        "description": "Returns tracker summary cards and aggregate metrics for the selected date range.",
        "tags": [
          "Tracker"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Preset range such as today, yesterday, thisweek, thismonth, or custom.",
            "schema": {
              "type": "string"
            },
            "example": "thismonth"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Custom range start date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "Custom range end date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Tracker summary returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "trackedSec": 864000,
                    "activeSec": 720000,
                    "idleSec": 54000,
                    "breakSec": 90000,
                    "avgProductivity": 78
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tracker/dashboard-overview": {
      "get": {
        "operationId": "v1-dashboard-overview",
        "summary": "Dashboard Overview",
        "description": "Returns the personal dashboard overview for the authenticated API key context.",
        "tags": [
          "Tracker"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Dashboard overview returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "activeEmployees": 42,
                    "onlineNow": 12,
                    "avgProductivityScore": 78.5,
                    "pendingTimeRequests": 5
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tracker/org-dashboard-overview": {
      "get": {
        "operationId": "v1-org-dashboard-overview",
        "summary": "Organization Dashboard Overview",
        "description": "Returns the organisation-wide dashboard overview including all employees, departments, and aggregate stats.",
        "tags": [
          "Tracker"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Org dashboard overview returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "totalEmployees": 50,
                    "onlineNow": 12,
                    "avgProductivityScore": 76,
                    "departments": 6
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tracker/insights": {
      "get": {
        "operationId": "v1-tracker-insights",
        "summary": "Employee Insights",
        "description": "Returns app, browser, attendance, productivity, and work pattern insights for an employee, team, or accessible scope.",
        "tags": [
          "Tracker"
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Number of days to include. Defaults to 30.",
            "schema": {
              "type": "integer"
            },
            "example": "30"
          },
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "description": "Employee ID when requesting a single employee.",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Scope selector such as self, employee, team, or organization.",
            "schema": {
              "type": "string"
            },
            "example": "employee"
          },
          {
            "name": "teamId",
            "in": "query",
            "required": false,
            "description": "Team ID when scope is team.",
            "schema": {
              "type": "string"
            },
            "example": "team_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Insights returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "days": 30,
                    "productivity": {
                      "averageScore": 81
                    },
                    "topApps": [
                      {
                        "name": "VS Code",
                        "totalSec": 198000
                      }
                    ],
                    "attendance": {
                      "presentDays": 22
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tracker/timeline": {
      "get": {
        "operationId": "v1-timeline-calendar",
        "summary": "Timeline Calendar",
        "description": "Returns the timeline calendar for an employee for a given month and year.",
        "tags": [
          "Tracker"
        ],
        "parameters": [
          {
            "name": "employeeId",
            "in": "query",
            "required": true,
            "description": "Employee ID",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "month",
            "in": "query",
            "required": true,
            "description": "Month number (1–12)",
            "schema": {
              "type": "integer"
            },
            "example": "5"
          },
          {
            "name": "year",
            "in": "query",
            "required": true,
            "description": "Full year",
            "schema": {
              "type": "integer"
            },
            "example": "2026"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "Specific date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-22"
          }
        ],
        "responses": {
          "200": {
            "description": "Timeline calendar returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "employeeId": "emp_001",
                    "month": 5,
                    "year": 2026,
                    "days": [
                      {
                        "date": "2026-05-01",
                        "workedHours": 7.5,
                        "status": "present"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tracker/timeline/chunk": {
      "get": {
        "operationId": "v1-timeline-chunk",
        "summary": "Timeline Chunk",
        "description": "Returns detailed timeline events, sessions, breaks, screenshots, and app/browser usage between two ISO datetimes.",
        "tags": [
          "Tracker"
        ],
        "parameters": [
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "description": "Employee ID. Defaults to the authenticated employee when omitted.",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "start",
            "in": "query",
            "required": true,
            "description": "Inclusive ISO datetime range start.",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26T09:00:00+05:30"
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "description": "Inclusive ISO datetime range end.",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26T18:00:00+05:30"
          }
        ],
        "responses": {
          "200": {
            "description": "Timeline chunk returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "employeeId": "emp_001",
                    "range": {
                      "start": "2026-07-26T09:00:00+05:30",
                      "end": "2026-07-26T18:00:00+05:30"
                    },
                    "sessions": [],
                    "appUsage": [],
                    "browserUsage": [],
                    "screenshots": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid date range",
            "content": {
              "application/json": {
                "example": {
                  "message": "start and end are required query parameters"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tracker/timeline/chunk/{employee_id}": {
      "get": {
        "operationId": "v1-timeline-chunk-employee",
        "summary": "Employee Timeline Chunk",
        "description": "Returns detailed timeline chunk data for the employee specified in the path.",
        "tags": [
          "Tracker"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "description": "Employee ID.",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "start",
            "in": "query",
            "required": true,
            "description": "Inclusive ISO datetime range start.",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26T09:00:00+05:30"
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "description": "Inclusive ISO datetime range end.",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26T18:00:00+05:30"
          }
        ],
        "responses": {
          "200": {
            "description": "Employee timeline chunk returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "employeeId": "emp_001",
                    "sessions": [],
                    "activityEvents": [],
                    "screenshots": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tracker/timeline/{employee_id}": {
      "get": {
        "operationId": "v1-timeline-calendar-employee",
        "summary": "Employee Timeline Calendar",
        "description": "Returns the monthly timeline calendar for the employee specified in the path.",
        "tags": [
          "Tracker"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "description": "Employee ID.",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "description": "Month number (1-12). Required unless date is supplied.",
            "schema": {
              "type": "integer"
            },
            "example": "7"
          },
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Full year. Required unless date is supplied.",
            "schema": {
              "type": "integer"
            },
            "example": "2026"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "Date used to infer month and year (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Employee timeline calendar returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "employeeId": "emp_001",
                    "month": 7,
                    "year": 2026,
                    "days": [
                      {
                        "date": "2026-07-26",
                        "status": "present",
                        "trackedSec": 27300
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tracker/live-users": {
      "get": {
        "operationId": "v1-live-users",
        "summary": "Live Users",
        "description": "Returns the list of employees currently active in the tracker.",
        "tags": [
          "Tracker"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Live users returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "employeeId": "emp_001",
                      "name": "Alice Johnson",
                      "status": "Active",
                      "lastSeen": "2026-05-22T11:45:00Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tracker/quotas": {
      "get": {
        "operationId": "v1-quotas",
        "summary": "Quotas",
        "description": "Returns API v1 quota usage for the authenticated key. Note: the quota endpoint logs usage after the response finishes, so the current request appears on the next quota call.",
        "tags": [
          "Tracker"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Quota details returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "plan": "premium",
                    "apiV1Requests": {
                      "used": 312,
                      "limit": 10000,
                      "resetAt": "2026-06-01T00:00:00Z"
                    },
                    "perKey": [
                      {
                        "id": "key_abc123",
                        "requestsUsed": 312
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/tracker/settings": {
      "get": {
        "operationId": "v1-employee-settings",
        "summary": "Employee Settings",
        "description": "Returns tracker settings for the authenticated context (screenshot interval, tracking mode, etc.).",
        "tags": [
          "Tracker"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Employee settings returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "screenshotInterval": 10,
                    "trackingMode": "auto",
                    "allowManualTime": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/activity/sync": {
      "post": {
        "operationId": "v1-activity-sync",
        "summary": "Sync Activity Data",
        "description": "Accepts batched tracker activity data from an approved integration client.",
        "tags": [
          "Activity"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Activity batch synced",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "batchId": "batch_001",
                    "accepted": 1,
                    "rejected": 0
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Activity sync batch payload.",
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "batchId": "batch_001",
                "events": [
                  {
                    "type": "app_usage",
                    "employeeId": "emp_001",
                    "capturedAt": "2026-07-26T10:15:00Z",
                    "appName": "VS Code",
                    "durationSec": 300
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/activity/timeline/{employee_id}": {
      "get": {
        "operationId": "v1-activity-timeline",
        "summary": "Activity Timeline",
        "description": "Returns the activity timeline for an employee on a specific date.",
        "tags": [
          "Activity"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "description": "Employee ID",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "Date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-22"
          }
        ],
        "responses": {
          "200": {
            "description": "Activity timeline returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "employeeId": "emp_001",
                    "date": "2026-05-22",
                    "segments": [
                      {
                        "startTime": "09:00",
                        "endTime": "09:30",
                        "type": "active",
                        "app": "VS Code"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/activity/screenshots/{employee_id}": {
      "get": {
        "operationId": "v1-screenshots",
        "summary": "Screenshot Gallery Read",
        "description": "Returns screenshot gallery entries (metadata and URLs) for an employee on a specific date. Upload and delete operations are not part of the API v1 surface.",
        "tags": [
          "Activity"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "description": "Employee ID",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "Date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-22"
          }
        ],
        "responses": {
          "200": {
            "description": "Screenshots returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "ss_001",
                      "takenAt": "2026-05-22T10:05:00Z",
                      "url": "https://cdn.example.com/ss_001.jpg",
                      "app": "Chrome"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/activity/raw/{employee_id}": {
      "get": {
        "operationId": "v1-raw-activity",
        "summary": "Raw Activity",
        "description": "Returns raw activity log entries (app name, window title, timestamps) for an employee on a specific date.",
        "tags": [
          "Activity"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "description": "Employee ID",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "Date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-22"
          }
        ],
        "responses": {
          "200": {
            "description": "Raw activity returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "app": "VS Code",
                      "windowTitle": "api-docs-data.ts",
                      "startedAt": "2026-05-22T09:01:00Z",
                      "durationSec": 1800
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/attendance/status": {
      "get": {
        "operationId": "v1-attendance-status",
        "summary": "Attendance Status",
        "description": "Returns the current attendance status for all employees.",
        "tags": [
          "Attendance"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Attendance status returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "employeeId": "emp_001",
                      "name": "Alice Johnson",
                      "status": "present",
                      "checkedInAt": "2026-05-22T09:00:00Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/attendance/list": {
      "get": {
        "operationId": "v1-attendance-list",
        "summary": "Attendance List",
        "description": "Returns attendance dashboard list rows for the selected date range and accessible employee scope.",
        "tags": [
          "Attendance"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Preset range such as today, yesterday, thisweek, thismonth, or custom.",
            "schema": {
              "type": "string"
            },
            "example": "today"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Custom range start date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "Custom range end date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          },
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "description": "Filter by employee ID.",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Attendance list returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "employeeId": "emp_001",
                      "date": "2026-07-26",
                      "primaryStatus": "full_day",
                      "secondaryStatus": "none",
                      "workSec": 28800
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/attendance/summary": {
      "get": {
        "operationId": "v1-attendance-summary",
        "summary": "Attendance Summary",
        "description": "Returns attendance summary totals and status counts for the selected range.",
        "tags": [
          "Attendance"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Preset range such as today, yesterday, thisweek, thismonth, or custom.",
            "schema": {
              "type": "string"
            },
            "example": "thismonth"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Custom range start date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "Custom range end date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Attendance summary returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "present": 22,
                    "absent": 1,
                    "halfDay": 2,
                    "noLogout": 1,
                    "onLeave": 3
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/attendance/history": {
      "get": {
        "operationId": "v1-attendance-history",
        "summary": "Attendance History",
        "description": "Returns historical attendance records filtered by date and optionally by employee.",
        "tags": [
          "Attendance"
        ],
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "Date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-22"
          },
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "description": "Filter by employee ID",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Attendance history returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "employeeId": "emp_001",
                      "date": "2026-05-22",
                      "checkedIn": "09:00",
                      "checkedOut": "18:02",
                      "workedHours": 8.5
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/attendance/day-details": {
      "get": {
        "operationId": "v1-attendance-day-details",
        "summary": "Attendance Day Details",
        "description": "Returns detailed attendance, session, break, screenshot count, leave, manual request, and audit data for one employee on one date.",
        "tags": [
          "Attendance"
        ],
        "parameters": [
          {
            "name": "employeeId",
            "in": "query",
            "required": true,
            "description": "Employee ID.",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "Date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Attendance day details returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "employeeId": "emp_001",
                    "date": "2026-07-26",
                    "sessions": [],
                    "breaks": [],
                    "mediaCount": 12,
                    "auditLogs": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/attendance/admin/status": {
      "patch": {
        "operationId": "v1-attendance-admin-status",
        "summary": "Update Attendance Status",
        "description": "Updates an employee attendance status using employeeId and date from the query string or request body.",
        "tags": [
          "Attendance"
        ],
        "parameters": [
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "description": "Employee ID when not provided in the body.",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "Attendance date when not provided in the body.",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Attendance status updated",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "employeeId": "emp_001",
                    "workDate": "2026-07-26",
                    "primaryStatus": "full_day",
                    "secondaryStatus": "manual_attendance"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Attendance status update fields.",
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "employeeId": "emp_001",
                "date": "2026-07-26",
                "primaryStatus": "full_day",
                "secondaryStatus": "manual_attendance",
                "remarks": "Approved manual correction"
              }
            }
          }
        }
      }
    },
    "/attendance/admin/status/{employee_id}/{date}": {
      "patch": {
        "operationId": "v1-attendance-admin-status-by-date",
        "summary": "Update Attendance Status By Path",
        "description": "Updates an employee attendance status using employee ID and date path parameters.",
        "tags": [
          "Attendance"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "description": "Employee ID.",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "date",
            "in": "path",
            "required": true,
            "description": "Attendance date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Attendance status updated",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "employeeId": "emp_001",
                    "workDate": "2026-07-26",
                    "primaryStatus": "half_day",
                    "secondaryStatus": "late_entry"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "requestBody": {
          "description": "Attendance status update fields.",
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "primaryStatus": "half_day",
                "secondaryStatus": "late_entry",
                "remarks": "Late arrival approved"
              }
            }
          }
        }
      }
    },
    "/attendance/admin/audit-logs": {
      "get": {
        "operationId": "v1-attendance-audit-logs",
        "summary": "Attendance Audit Logs",
        "description": "Returns manual attendance status change audit logs for the organization.",
        "tags": [
          "Attendance"
        ],
        "parameters": [
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "description": "Filter by employee ID.",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "Filter by one work date.",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Start of work date range.",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "End of work date range.",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Attendance audit logs returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "employeeId": "emp_001",
                      "workDate": "2026-07-26",
                      "updatedBy": "usr_001",
                      "previous": {},
                      "next": {},
                      "remarks": "Approved manual correction"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/attendance": {
      "get": {
        "operationId": "v1-report-attendance",
        "summary": "Attendance Report",
        "description": "Returns an attendance report for a date range.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "Start date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "End date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-22"
          }
        ],
        "responses": {
          "200": {
            "description": "Attendance report returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "totalDays": 22,
                    "present": 20,
                    "absent": 1,
                    "leave": 1,
                    "employees": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/activity-history": {
      "get": {
        "operationId": "v1-report-activity-history",
        "summary": "Activity History",
        "description": "Returns aggregated activity history report for a date range.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "Start date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "End date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-22"
          }
        ],
        "responses": {
          "200": {
            "description": "Activity history returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "totalTrackedHours": 880,
                    "avgHoursPerDay": 8,
                    "topApps": [
                      "VS Code",
                      "Chrome",
                      "Slack"
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/productivity": {
      "get": {
        "operationId": "v1-report-productivity",
        "summary": "Productivity Report",
        "description": "Returns a productivity report for the organisation over a date range.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "Start date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "End date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-22"
          }
        ],
        "responses": {
          "200": {
            "description": "Productivity report returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "avgScore": 76.4,
                    "productive": 68,
                    "neutral": 18,
                    "unproductive": 14
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/productivity/score/{employee_id}": {
      "get": {
        "operationId": "v1-report-productivity-score",
        "summary": "Detailed Productivity Score",
        "description": "Returns productivity score category counts for a specific employee, optionally filtered to one date.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "description": "Employee ID.",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "Optional date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Detailed productivity score returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "employeeId": "emp_001",
                    "date": "2026-07-26",
                    "productive": 42,
                    "neutral": 9,
                    "unproductive": 3
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/org-summary": {
      "get": {
        "operationId": "v1-report-org-summary",
        "summary": "Organization Summary",
        "description": "Returns a high-level organisation summary report over a date range.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "Start date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "End date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-22"
          }
        ],
        "responses": {
          "200": {
            "description": "Org summary returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "totalEmployees": 50,
                    "avgAttendanceRate": 92,
                    "avgProductivity": 76,
                    "totalTrackedHours": 8800
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/team-summary": {
      "get": {
        "operationId": "v1-report-team-summary",
        "summary": "Team Summary",
        "description": "Returns a summary report broken down by team for a date range.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "Start date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "End date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-22"
          }
        ],
        "responses": {
          "200": {
            "description": "Team summary returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "teamId": "team_001",
                      "name": "Engineering",
                      "avgProductivity": 80,
                      "totalHours": 1760
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/employees": {
      "get": {
        "operationId": "v1-report-employees",
        "summary": "Employee Tracker Report",
        "description": "Returns daily tracker report rows for one employee or all Tracker-enabled employees in the selected range.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Preset range such as today, yesterday, thisweek, thismonth, last60days, last90days, or custom.",
            "schema": {
              "type": "string"
            },
            "example": "thismonth"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Custom range start date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "Custom range end date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          },
          {
            "name": "employeeId",
            "in": "query",
            "required": false,
            "description": "Employee ID or all. Defaults to all.",
            "schema": {
              "type": "string"
            },
            "example": "all"
          }
        ],
        "responses": {
          "200": {
            "description": "Employee tracker report returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "filters": {
                      "employeeId": "all"
                    },
                    "summary": {
                      "employeeCount": 25,
                      "trackedHours": 1760,
                      "avgProductivity": 79
                    },
                    "records": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/teams/summary": {
      "get": {
        "operationId": "v1-report-teams-summary",
        "summary": "Team Tracker Report",
        "description": "Returns tracker report totals grouped by team for the selected date range.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "Preset range such as today, yesterday, thisweek, thismonth, last60days, last90days, or custom.",
            "schema": {
              "type": "string"
            },
            "example": "today"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Custom range start date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "Custom range end date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Team tracker report returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "summary": {
                      "teamCount": 6,
                      "trackedHours": 880
                    },
                    "records": [
                      {
                        "team": {
                          "id": "team_001",
                          "name": "Engineering"
                        },
                        "trackedSec": 3168000
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/department-summary": {
      "get": {
        "operationId": "v1-report-department-summary",
        "summary": "Department Summary",
        "description": "Returns a summary report broken down by department for a date range.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "Start date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "End date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-22"
          }
        ],
        "responses": {
          "200": {
            "description": "Department summary returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "deptId": "dept_001",
                      "name": "Engineering",
                      "avgProductivity": 79,
                      "totalHours": 3520
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/export": {
      "get": {
        "operationId": "v1-report-export",
        "summary": "Export Report",
        "description": "Exports a report as CSV or XLSX. Pass the report type and date range as query parameters.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": true,
            "description": "Report type (attendance, productivity, activity-history, org-summary, team-summary, department-summary)",
            "schema": {
              "type": "string"
            },
            "example": "attendance"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "Start date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "End date (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            },
            "example": "2026-05-22"
          }
        ],
        "responses": {
          "200": {
            "description": "Export file returned (CSV or XLSX)",
            "content": {
              "application/json": {
                "example": {
                  "downloadUrl": "https://cdn.example.com/reports/export_abc123.csv",
                  "expiresAt": "2026-05-22T12:00:00Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/history": {
      "get": {
        "operationId": "v1-report-history",
        "summary": "Report History",
        "description": "Returns the history of generated reports (type, date range, status, download URL).",
        "tags": [
          "Reports"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Report history returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "rpt_001",
                      "type": "attendance",
                      "startDate": "2026-05-01",
                      "endDate": "2026-05-22",
                      "status": "ready",
                      "downloadUrl": "https://cdn.example.com/rpt_001.csv"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/{job_id}/status": {
      "get": {
        "operationId": "v1-report-status",
        "summary": "Report Job Status",
        "description": "Returns the status of an asynchronous report generation job.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "Report job ID.",
            "schema": {
              "type": "string"
            },
            "example": "rpt_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Report status returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "rpt_001",
                    "status": "completed",
                    "fileUrl": "https://cdn.example.com/rpt_001.xlsx"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Report job not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Report job not found"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/{job_id}/download": {
      "get": {
        "operationId": "v1-report-download",
        "summary": "Download Report",
        "description": "Returns a generated report download URL once the report job is completed.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "Report job ID.",
            "schema": {
              "type": "string"
            },
            "example": "rpt_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Download URL returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "url": "https://cdn.example.com/rpt_001.xlsx"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Report is not ready",
            "content": {
              "application/json": {
                "example": {
                  "message": "Report not ready or not found"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/export/employee/{id}": {
      "get": {
        "operationId": "v1-report-employee-export",
        "summary": "Export Employee CSV",
        "description": "Initializes a CSV export for a specific employee tracker report.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Employee ID.",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Employee CSV export initialized",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "url": "/exports/employee_emp_001.csv"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/platform-stats": {
      "get": {
        "operationId": "v1-report-platform-stats",
        "summary": "Platform Stats",
        "description": "Returns counts of active Tracker employees by operating system and application version.",
        "tags": [
          "Reports"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Platform stats returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "os": {
                      "Windows": 18,
                      "macOS": 5,
                      "Linux": 2
                    },
                    "appVersions": {
                      "0.5.0": 21,
                      "0.4.0": 4
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/reports/seat-usage": {
      "get": {
        "operationId": "v1-report-seat-usage",
        "summary": "Seat Usage Report",
        "description": "Returns Tracker seat allocation and usage for the active subscription.",
        "tags": [
          "Reports"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Seat usage returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "planName": "Premium",
                    "totalSeats": 50,
                    "usedSeats": 37,
                    "availableSeats": 13,
                    "usagePercentage": 74
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/productivity": {
      "get": {
        "operationId": "v1-productivity-rules",
        "summary": "Productivity Rules Read",
        "description": "Returns all productivity rules configured for the organisation (app categorisations, productive/unproductive labels).",
        "tags": [
          "Productivity"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Productivity rules returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "app": "VS Code",
                      "category": "Development",
                      "label": "productive"
                    },
                    {
                      "app": "YouTube",
                      "category": "Entertainment",
                      "label": "unproductive"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/productivity/employee/{employee_id}/summary": {
      "get": {
        "operationId": "v1-employee-productivity-summary",
        "summary": "Employee Productivity Summary",
        "description": "Returns the productivity summary for a specific employee.",
        "tags": [
          "Productivity"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "description": "Employee ID",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Employee productivity summary returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "employeeId": "emp_001",
                    "score": 82,
                    "productive": 74,
                    "neutral": 14,
                    "unproductive": 12
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/productivity/employee/{employee_id}/week": {
      "get": {
        "operationId": "v1-employee-productivity-week",
        "summary": "Employee Productivity Week",
        "description": "Returns the week-by-week productivity breakdown for a specific employee.",
        "tags": [
          "Productivity"
        ],
        "parameters": [
          {
            "name": "employee_id",
            "in": "path",
            "required": true,
            "description": "Employee ID",
            "schema": {
              "type": "string"
            },
            "example": "emp_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Weekly productivity breakdown returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "employeeId": "emp_001",
                    "weeks": [
                      {
                        "week": 1,
                        "score": 80
                      },
                      {
                        "week": 2,
                        "score": 84
                      },
                      {
                        "week": 3,
                        "score": 78
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/productivity/team/{team_id}/summary": {
      "get": {
        "operationId": "v1-team-productivity-summary",
        "summary": "Team Productivity Summary",
        "description": "Returns productivity summary metrics for all Tracker employees in a team.",
        "tags": [
          "Productivity"
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "description": "Team ID.",
            "schema": {
              "type": "string"
            },
            "example": "team_001"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Range start date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "Range end date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Team productivity summary returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "teamId": "team_001",
                    "employeeCount": 12,
                    "productiveSec": 580000,
                    "unproductiveSec": 62000,
                    "avgProductivity": 82
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/productivity/org/overview": {
      "get": {
        "operationId": "v1-org-productivity-overview",
        "summary": "Organization Productivity Overview",
        "description": "Returns the organisation-wide productivity overview including aggregated scores and top/bottom performers.",
        "tags": [
          "Productivity"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Org productivity overview returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "avgScore": 76,
                    "topPerformers": [
                      {
                        "employeeId": "emp_001",
                        "score": 92
                      }
                    ],
                    "bottomPerformers": [
                      {
                        "employeeId": "emp_010",
                        "score": 48
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/productivity/team/{team_id}/trends": {
      "get": {
        "operationId": "v1-team-productivity-trends",
        "summary": "Team Productivity Trends",
        "description": "Returns productivity trend data for all Tracker employees in a team over the selected range.",
        "tags": [
          "Productivity"
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "description": "Team ID.",
            "schema": {
              "type": "string"
            },
            "example": "team_001"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Range start date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "Range end date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Team productivity trends returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "date": "2026-07-26",
                      "productiveSec": 28800,
                      "unproductiveSec": 2400,
                      "productivityScore": 86
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/teams/directory": {
      "get": {
        "operationId": "v1-team-directory",
        "summary": "Team Directory",
        "description": "Returns a directory listing of all teams with member counts and managers.",
        "tags": [
          "Teams"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Team directory returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "teamId": "team_001",
                      "name": "Engineering",
                      "memberCount": 12,
                      "manager": "Alice Johnson"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/teams/stats": {
      "get": {
        "operationId": "v1-team-stats",
        "summary": "Team Stats",
        "description": "Returns productivity and attendance stats aggregated at the team level.",
        "tags": [
          "Teams"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Team stats returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "teamId": "team_001",
                      "name": "Engineering",
                      "avgProductivity": 80,
                      "attendanceRate": 94
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/teams/performance": {
      "get": {
        "operationId": "v1-team-performance",
        "summary": "Organization Team Performance",
        "description": "Returns trend and performance data across the organization or manager-accessible team scope.",
        "tags": [
          "Teams"
        ],
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Range start date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "Range end date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Team performance returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "date": "2026-07-26",
                      "activeSec": 288000,
                      "idleSec": 24000,
                      "productivityScore": 81
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/teams/performance/{id}": {
      "get": {
        "operationId": "v1-team-performance-by-id",
        "summary": "Team Performance By ID",
        "description": "Returns trend and performance data for a single team.",
        "tags": [
          "Teams"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Team ID.",
            "schema": {
              "type": "string"
            },
            "example": "team_001"
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "Range start date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-01"
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "Range end date (YYYY-MM-DD).",
            "schema": {
              "type": "string"
            },
            "example": "2026-07-26"
          }
        ],
        "responses": {
          "200": {
            "description": "Team performance returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "date": "2026-07-26",
                      "teamId": "team_001",
                      "activeSec": 42000,
                      "idleSec": 3600,
                      "productivityScore": 84
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/teams": {
      "get": {
        "operationId": "v1-teams-list",
        "summary": "Teams",
        "description": "Returns a full list of all teams in the organisation.",
        "tags": [
          "Teams"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Teams list returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "teamId": "team_001",
                      "name": "Engineering"
                    },
                    {
                      "teamId": "team_002",
                      "name": "Design"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/teams/timeline": {
      "get": {
        "operationId": "v1-team-timeline",
        "summary": "Team Timeline",
        "description": "Returns the timeline view aggregated across all team members.",
        "tags": [
          "Teams"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Team timeline returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "teams": [
                      {
                        "teamId": "team_001",
                        "days": [
                          {
                            "date": "2026-05-22",
                            "avgHours": 7.8
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/projects": {
      "get": {
        "operationId": "v1-projects-list",
        "summary": "Projects",
        "description": "Returns all projects in the organisation.",
        "tags": [
          "Projects"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Projects returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "projectId": "proj_001",
                      "name": "API Docs Portal",
                      "status": "active",
                      "memberCount": 5
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/projects/stats": {
      "get": {
        "operationId": "v1-project-stats",
        "summary": "Project Stats",
        "description": "Returns aggregated stats across all projects (total hours logged, active vs completed, etc.).",
        "tags": [
          "Projects"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Project stats returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "totalProjects": 8,
                    "activeProjects": 5,
                    "totalLoggedHours": 3200
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/projects/logs": {
      "get": {
        "operationId": "v1-project-logs",
        "summary": "Project Logs",
        "description": "Returns time log entries across all projects.",
        "tags": [
          "Projects"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Project logs returned",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "logId": "log_001",
                      "projectId": "proj_001",
                      "employeeId": "emp_001",
                      "date": "2026-05-22",
                      "hours": 3.5
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/projects/export": {
      "get": {
        "operationId": "v1-project-export",
        "summary": "Project Export",
        "description": "Exports all project data (logs, members, stats) as a downloadable file.",
        "tags": [
          "Projects"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Export file returned",
            "content": {
              "application/json": {
                "example": {
                  "downloadUrl": "https://cdn.example.com/projects/export_xyz.csv",
                  "expiresAt": "2026-05-22T14:00:00Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    },
    "/projects/{project_id}": {
      "get": {
        "operationId": "v1-project-details",
        "summary": "Project Details",
        "description": "Returns detailed information for a specific project including members, milestones, and time logs.",
        "tags": [
          "Projects"
        ],
        "parameters": [
          {
            "name": "project_id",
            "in": "path",
            "required": true,
            "description": "Project ID",
            "schema": {
              "type": "string"
            },
            "example": "proj_001"
          }
        ],
        "responses": {
          "200": {
            "description": "Project details returned",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "projectId": "proj_001",
                    "name": "API Docs Portal",
                    "status": "active",
                    "totalLoggedHours": 320,
                    "members": [
                      "emp_001",
                      "emp_002"
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  }
}
