Overview
Time entries track work hours for users within a company. Each entry can be linked to projects, clients, client sites, and categories. The API automatically calculates overtime and applies appropriate rates based on client rate rules.Key Features
- Automatic Overtime Detection: Entries are automatically marked as overtime based on client rate rules (weekends, after-hours, or manual)
- Rate Application: Hourly rates are automatically applied from active client rate rules
- Manager Logging: Owners and admins can log hours on behalf of team members
- Flexible Filtering: List entries by company, project, user, client, category, date range, and overtime status
- Real-time Notifications: Company owners and platform admins receive SSE notifications on entry changes
Authentication
All endpoints require:- Valid JWT authentication token
- Platform admin role (checked via middleware)
Create Time Entry
Request Body
UUID of the company
UUID of the project (optional)
Date of the time entry (ISO 8601 format)
Number of hours worked (minimum 0.01)
Start time in HH:mm format (e.g., “09:00”)
End time in HH:mm format (e.g., “17:30”)
Entry title (1-200 characters)
Detailed description (max 2000 characters)
Manually mark as overtime (only used if client has MANUAL trigger)
UUID of the client (enables automatic overtime calculation)
UUID of the client site
UUID of the time entry category
UUID of the user to log hours for (owner/admin only). If not provided, logs for authenticated user.
Response Fields
All request fields plus:id: Generated UUIDuserId: Owner of the time entryisOvertime: Calculated based on client rate rulesappliedRatePerHour: Rate applied from client rate rule (if applicable)loggedByUserId: Set when an owner/admin logs for another usercreatedAt,updatedAt: Timestamps- Related objects:
user,project,company,client,clientSite,category,loggedByUser
List Time Entries
Query Parameters
Page number (min: 1)
Items per page (1-500)
Filter by company UUID
Filter by project UUID
Filter by user UUID (owner/admin only for other users)
Filter by client UUID
Filter by category UUID
Filter by overtime status
Start date for date range filter (ISO 8601)
End date for date range filter (ISO 8601)
Access Control
- Platform Admins: Can view all entries across all companies
- Company Owners/Admins: Can view all entries in their company
- Regular Members: Can only view their own entries
Get Time Entry by ID
Path Parameters
UUID of the time entry
Update Time Entry
Path Parameters
UUID of the time entry
Request Body
All fields from creation are optional. WhenclientId, date, startTime, endTime, or isOvertime are updated, overtime status and rate are automatically recalculated.
Update project assignment
Update date (triggers overtime recalculation)
Update hours worked
Update start time (triggers overtime recalculation)
Update end time (triggers overtime recalculation)
Update title
Update description
Update overtime status (triggers rate recalculation)
Update client (triggers overtime recalculation)
Update client site
Update category
Access Control
- Users can update their own entries
- Company owners/admins can update any entry in their company
- Platform admins can update any entry
Delete Time Entry
Path Parameters
UUID of the time entry to delete
Access Control
Same as update: users can delete their own entries, company owners/admins can delete any entry in their company.Get Time Summary
Query Parameters
Company UUID to get summary for
Start date (ISO 8601 format)
End date (ISO 8601 format)
Response Fields
totalHours: Sum of all hours in the date rangetotalEntries: Count of time entriesstartDate,endDate: Date range queriedbyProject: Array of project summaries with hours and entry counts
Overtime Calculation
When a time entry is linked to a client with active rate rules, overtime is automatically calculated based on the rule’s triggers:Trigger Types
WEEKEND- Automatically marks entries on Saturday (6) or Sunday (0) as overtime
- Uses
date.getDay()to determine day of week
- Requires
startTime,endTime,workdayStartTime, andworkdayEndTimeon the rate rule - Marks as overtime if work starts before
workdayStartTimeor ends afterworkdayEndTime - Example: Work starts at 07:00 when workday starts at 09:00
- Allows user to manually set
isOvertime: truein the request - Gives control to the user or manager logging the entry
Rate Application
When overtime is detected:appliedRatePerHouris set toovertimeRatePerHourfrom the rate rule
appliedRatePerHouris set tobaseRatePerHourfrom the rate rule (if defined)- Can be
nullif no base rate is configured
Rule Selection
The system selects the most recent active rate rule where:clientIdmatchesisActiveistrueeffectiveFrom <= entry.dateeffectiveToisnullOReffectiveTo >= entry.date
Real-time Notifications
Time entry changes trigger SSE events sent to:- All company owners (users with “Owner” role)
- All platform admins
Event Format
created, updated, deleted