📡 API Reference

Time Tracking Endpoints

API endpoints for time logs, timesheets, activity tracking, and screenshots.

Time Logs

List Time Logs

GET /api/timesheet/time-log?startDate=2024-01-01&endDate=2024-01-31
Authorization: Bearer {token}

Response (200 OK):

{
  "items": [
    {
      "id": "...",
      "startedAt": "2024-01-15T09:00:00.000Z",
      "stoppedAt": "2024-01-15T17:00:00.000Z",
      "duration": 28800,
      "logType": "TRACKED",
      "source": "DESKTOP",
      "description": "Working on feature X",
      "employeeId": "...",
      "projectId": "...",
      "taskId": "...",
      "organizationId": "..."
    }
  ],
  "total": 150
}

Create Time Log

POST /api/timesheet/time-log
Authorization: Bearer {token}
Content-Type: application/json

{
  "startedAt": "2024-01-15T09:00:00.000Z",
  "stoppedAt": "2024-01-15T17:00:00.000Z",
  "logType": "MANUAL",
  "source": "WEB_TIMER",
  "description": "Working on feature X",
  "projectId": "project-uuid",
  "taskId": "task-uuid",
  "organizationId": "org-uuid",
  "isBillable": true
}

Update Time Log

PUT /api/timesheet/time-log/{id}
Authorization: Bearer {token}
Content-Type: application/json

{
  "stoppedAt": "2024-01-15T18:00:00.000Z",
  "description": "Updated description"
}

Delete Time Log

DELETE /api/timesheet/time-log/{id}
Authorization: Bearer {token}

Log Types

TypeDescriptionSource
TRACKEDTracked by desktop timerDesktop Timer app
MANUALManually enteredWeb UI or API
IDLEIdle time (automatically detected)Desktop Timer
RESUMEDResumed from idleDesktop Timer

Log Sources

SourceDescription
WEB_TIMERBrowser-based timer
DESKTOPDesktop Timer app
MOBILEMobile app
BROWSER_EXTENSIONBrowser extension
HUBSTAFFHubStaff integration
UPWORKUpwork integration

Timesheets

List Timesheets

GET /api/timesheet?startDate=2024-01-01&endDate=2024-01-31
Authorization: Bearer {token}

Submit Timesheet

PUT /api/timesheet/submit
Authorization: Bearer {token}
Content-Type: application/json

{
  "ids": ["timesheet-uuid-1", "timesheet-uuid-2"],
  "status": "PENDING"
}

Approve Timesheet

PUT /api/timesheet/approve
Authorization: Bearer {token}
Content-Type: application/json

{
  "ids": ["timesheet-uuid-1"]
}

Deny Timesheet

PUT /api/timesheet/deny
Authorization: Bearer {token}
Content-Type: application/json

{
  "ids": ["timesheet-uuid-1"]
}

Timesheet Statuses

StatusDescription
DRAFTNot yet submitted
PENDINGSubmitted, awaiting approval
IN_REVIEWUnder review
APPROVEDApproved by manager
DENIEDRejected by manager

Activity & Screenshots

Get Activities

GET /api/timesheet/activity?startDate=2024-01-01&endDate=2024-01-31&employeeId={id}
Authorization: Bearer {token}

Get Screenshots

GET /api/timesheet/screenshot?startDate=2024-01-01&endDate=2024-01-31
Authorization: Bearer {token}

Response:

{
  "items": [
    {
      "id": "...",
      "file": "https://storage.example.com/screenshots/uuid.png",
      "thumb": "https://storage.example.com/screenshots/uuid-thumb.png",
      "recordedAt": "2024-01-15T10:30:00.000Z",
      "timeSlotId": "...",
      "employeeId": "..."
    }
  ]
}

Statistics

Get Time Summary

GET /api/timesheet/statistics/counts?startDate=2024-01-01&endDate=2024-01-31
Authorization: Bearer {token}

Response:

{
  "weeklyDuration": 144000,
  "weeklyActivities": 85,
  "todayDuration": 28800,
  "todayActivities": 12
}

Get Project Time Report

GET /api/timesheet/time-log/report/daily-chart?startDate=2024-01-01&endDate=2024-01-31&groupBy=project
Authorization: Bearer {token}

Timer

Start Timer

POST /api/timesheet/timer/start
Authorization: Bearer {token}
Content-Type: application/json

{
  "projectId": "project-uuid",
  "taskId": "task-uuid",
  "organizationId": "org-uuid",
  "description": "Working on feature"
}

Stop Timer

POST /api/timesheet/timer/stop
Authorization: Bearer {token}
Content-Type: application/json

{
  "organizationId": "org-uuid"
}

Toggle Timer

POST /api/timesheet/timer/toggle
Authorization: Bearer {token}
Content-Type: application/json

{
  "projectId": "project-uuid",
  "taskId": "task-uuid",
  "organizationId": "org-uuid"
}

Required Permissions

EndpointPermission
GET /api/timesheet/time-logTIME_TRACKER
POST /api/timesheet/time-logTIME_TRACKER
PUT /api/timesheet/approveCAN_APPROVE_TIMESHEET
GET /api/timesheet/screenshotTIME_TRACKER

Edit this page

Copyright © 2023-Present Ever Co. LTD.Docs by Sourcey