# Get Tracked Hours Report Retrieve tracked hours report data for a workspace. Supports filtering by users, projects, teams, and titles. Data is always grouped by day. Always returns: Day-by-day breakdown grouped by date (date as key), with users array inside each date. Tracked time is returned in minutes (total_minutes field), aggregated across all tracking methods and grouped by user_id, project_id, and contract_id. If user has access to rates (rate_status = 1), also returns total_amount as an object with currency codes as keys. When user_id is provided: Results are filtered to that specific user only. Date range is limited to maximum 31 days (1 month) when user_id is provided. Security: Only workspace owners and executive managers can access this endpoint. Endpoint: GET /reports/tracked-hours Version: 2.0.0 Security: oauth2, apiKey ## Query parameters: - `workspace_id` (integer, required) ID of the workspace (team_id from owner_user_rel table) Example: 1 - `user_id` (integer) Filter by specific user ID. When provided, results are filtered to that user only. Date range is limited to maximum 31 days. Example: 100 - `start_date` (string) Start date for the report (Y-m-d format). Defaults to start of current week if not provided. Maximum 31 days from end_date when user_id is provided. Example: "2024-01-01" - `end_date` (string) End date for the report (Y-m-d format). Defaults to end of current week if not provided. Maximum 31 days from start_date when user_id is provided. Example: "2024-01-31" - `users` (array) Filter by user IDs (comma-separated or array) Example: [1,2,3] - `projects` (array) Filter by project IDs (comma-separated or array) Example: [10,20] - `teams` (array) Filter by team IDs (comma-separated or array) Example: [5] - `titles` (array) Filter by title IDs (comma-separated or array) Example: [1] - `currencies` (array) Filter by currency codes (comma-separated or array). Only applicable when user has access to rates (rate_status = 1). Example: ["USD","EUR"] ## Response 200 fields (application/json): - `success` (boolean) Example: true - `data` (object) - `data.report_type` (string, required) Type of report Example: "tracked_hours" - `data.user_id` (integer,null) User ID when filtering by specific user (returns day-by-day breakdown) Example: 100 - `data.start_date` (string, required) Report start date Example: "2024-01-01" - `data.end_date` (string, required) Report end date Example: "2024-01-31" - `data.total` (object, required) Total aggregated data across all dates and users - `data.total.total_minutes` (integer, required) Total tracked minutes across all users and dates Example: 1440 - `data.total.total_amount` (object,null) Total amounts by currency (only present if user has access to rates, rate_status = 1). Object with currency codes as keys. Example: {"USD":155.67,"EUR":140.5} - `data.daily_breakdown` (object, required) Day-by-day breakdown grouped by date. Each date key contains a users array. Example: {"2024-01-15":{"users":[{"user_id":100,"total_minutes":304,"project_id":10,"contract_id":20,"total_amount":{"USD":120.5}},{"user_id":101,"total_minutes":480,"project_id":11,"contract_id":21},{"user_id":102,"total_minutes":240,"project_id":12,"contract_id":22,"total_amount":{"USD":95.25,"EUR":87.5}}]},"2024-01-16":{"users":[{"user_id":100,"total_minutes":480,"project_id":10,"contract_id":20},{"user_id":101,"total_minutes":360,"project_id":11,"contract_id":21},{"user_id":102,"total_minutes":300,"project_id":12,"contract_id":22}]}} - `message` (string) Example: "Tracked hours report retrieved successfully" - `meta` (object) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 400 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 401 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 403 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string) ## Response 500 fields (application/json): - `success` (boolean, required) - `message` (string, required) Error message describing what went wrong Example: "An error occurred" - `error` (string,null) Optional additional error details Example: "Internal Server Error" - `meta` (object, required) - `meta.api_version` (string) Example: "2.0.0" - `meta.timestamp` (string)