GET /api/work_time_entries
Get work-time entries list

Examples

{
  "collection": [
    {
      "id": 42,
      "user_id": 819,
      "user_name": "John Smith",
      "start_time": "2025-11-17T08:00:00.000Z",
      "end_time": "2025-11-17T17:00:00.000Z",
      "total_break_minutes": 60,
      "total_duration_minutes": 480,
      "description": "Monday, 8h",
      "payroll_timezone": "Europe/Helsinki",
      "reported_at": null,
      "entry_type": "regular",
      "treat_extra_time_as": "flex",
      "automatic": false,
      "state": "approved",
      "approver_ids": [41, 42]
      "approver_names": ["Paul Simon", "Art Garfunkel"],
      "approved_by": 41,
      "approvable": false
    }
  ],
  "pagination": {
    "current_page": 1,
    "total_pages": 1,
    "total_count": 1
  }
}

Params

Param name Description
page
optional

Page number.

Validations:

  • Must be a Integer

per_page
optional

Number of records per page. Default: 50.

Validations:

  • Must be a Integer

date_range
optional

Get all entries within the specified date range, e.g. 01/01/2026 - 31/01/2026.

Validations:

  • Must be a String

user_id
optional

Get all entries for the specified user.

Validations:

  • Must be a Integer

entry_type
optional

Get all entries of the specified work-time type.

Validations:

  • Must be one of: regular, remote, on_call, travel, training, staggered, travel_off_hours.

from_project_time
optional

Get entries created from project time (vs manually created).

Validations:

  • Must be one of: true, false.

automatic
optional

Get all auto-created (automatic) entries.

Validations:

  • Must be one of: true, false.

state
optional

Filter entries by state.

Validations:

  • Must be one of: pending, approved, unapproved, pending_my_approval.

sort_by
optional

Sort by field. Default: start_time.

Validations:

  • Must be a String

order
optional

Sorting order (descending or ascending). Default: asc.

Validations:

  • Must be one of: desc, asc.


GET /api/work_time_entries/export
Download work-time entries in XLSX format

Params

Param name Description
date_range
optional

Only export entries within the specified date range, e.g. 01/01/2026 - 31/01/2026.

Validations:

  • Must be a String

user_id
optional

Only export entries for the specified user.

Validations:

  • Must be a Integer

entry_type
optional

Only export entries of the specified work-time type.

Validations:

  • Must be one of: regular, remote, on_call, travel, training, staggered, travel_off_hours.

automatic
optional

Only export automatically/manually created entries.

Validations:

  • Must be one of: true, false.

state
optional

Filter entries by state.

Validations:

  • Must be one of: pending, approved, unapproved, pending_my_approval.

empty
optional

Pass true to download an empty Spreadsheet (no entries, column titles only), to be used as a template for inserting new work-time entries.

Validations:

  • Must be one of: true, false.


POST /api/work_time_entries/import
Upload an XLSX file with work-time entries to be created or updated

Upload an XLSX file (matching the export layout) containing work-time entries. Rows with a Bezala ID update the existing entry; rows without one create a new entry. Entries already reported to payroll cannot be updated.

The response contains import stats: number of created/updated entries, rows that failed with their errors etc. Row number is used as a key to identify the imported entry in response stats.

Examples

{
  "ok": true,
  "new": 2,
  "updated": 1,
  "failed": [6],
  "new_items": [4, 5],
  "updated_items": [7],
  "errors": {
    "6": ["Unknown work-time type 'Napping'"]
  }
}

Params

Param name Description
file
required

XLSX file with work-time entries.

Validations:

  • Must be a File


GET /api/work_time_entries/:id
Get a specific work-time entry

Examples

{
  "id": 42,
  "user_id": 819,
  "user_name": "John Smith",
  "start_time": "2025-11-17T08:00:00.000Z",
  "end_time": "2025-11-17T17:00:00.000Z",
  "total_break_minutes": 60,
  "total_duration_minutes": 480,
  "description": "Monday, 8h",
  "payroll_timezone": "Europe/Helsinki",
  "reported_at": null,
  "entry_type": "regular",
  "treat_extra_time_as": "flex",
  "automatic": true,
  "state": "approved",
  "approver_ids": [41, 42]
  "approver_names": ["Paul Simon", "Art Garfunkel"],
  "approved_by": 41,
  "approvable": false
}

Params

Param name Description
id
required

Entry ID

Validations:

  • Must be a Integer


POST /api/work_time_entries
Create a work-time entry

Params

Param name Description
work_time_entry
required

Validations:

  • Must be a Hash

work_time_entry[user_id]
optional

User ID. Falls back to current user’s ID.

Validations:

  • Must be a Integer

work_time_entry[start_time]
required

Work-time start, e.g. "2025-11-17T08:00:00.000Z".

Validations:

  • Must be a Integer

work_time_entry[end_time]
required

Work-time end, e.g. "2025-11-17T08:00:00.000Z".

Validations:

  • Must be a Integer

work_time_entry[total_break_minutes]
optional

Total breaks duration in minutes.

Validations:

  • Must be a Integer

work_time_entry[description]
optional

Work-time entry description.

Validations:

  • Must be a String

work_time_entry[entry_type]
optional

Entry type. Default: "regular".

Validations:

  • Must be one of: regular, remote, on_call, travel, training, staggered, travel_off_hours.

work_time_entry[treat_extra_time_as]
optional

Whether to treat overtime as flex or as paid overtime.

Validations:

  • Must be one of: not_selected, flex, paid_overtime, time_bank.


PUT /api/work_time_entries/:id
Update a work-time entry

Params

Param name Description
id
required

Entry ID

Validations:

  • Must be a Integer

work_time_entry
required

Validations:

  • Must be a Hash

work_time_entry[user_id]
optional

User ID. Falls back to current user’s ID.

Validations:

  • Must be a Integer

work_time_entry[start_time]
required

Work-time start, e.g. "2025-11-17T08:00:00.000Z".

Validations:

  • Must be a Integer

work_time_entry[end_time]
required

Work-time end, e.g. "2025-11-17T08:00:00.000Z".

Validations:

  • Must be a Integer

work_time_entry[total_break_minutes]
optional

Total breaks duration in minutes.

Validations:

  • Must be a Integer

work_time_entry[description]
optional

Work-time entry description.

Validations:

  • Must be a String

work_time_entry[entry_type]
optional

Entry type. Default: "regular".

Validations:

  • Must be one of: regular, remote, on_call, travel, training, staggered, travel_off_hours.

work_time_entry[treat_extra_time_as]
optional

Whether to treat overtime as flex or as paid overtime.

Validations:

  • Must be one of: not_selected, flex, paid_overtime, time_bank.


DELETE /api/work_time_entries/:id
Delete a work-time entry

Params

Param name Description
id
required

Entry ID

Validations:

  • Must be a Integer


PUT /api/work_time_entries/:id/approve
Approve a pending entry


PUT /api/work_time_entries/:id/unapprove
Unapprove a pending entry


POST /api/work_time_entries/mass_approve
Approve work-time entries en masse.

Use filter params to specify which entries to approve.

Params

Param name Description
date_range
optional

Only approve entries within the specified date range, e.g. 01/01/2026 - 31/01/2026.

Validations:

  • Must be a String

user_id
optional

Only approve entries for the specified user.

Validations:

  • Must be a Integer

entry_type
optional

Only approve entries of the specified work-time type.

Validations:

  • Must be one of: regular, remote, on_call, travel, training, staggered, travel_off_hours.

automatic
optional

Only approve automatically/manually created entries.

Validations:

  • Must be one of: true, false.


PUT /api/work_time_entries/:id/set_reported_at
Save timestamp of reporting the entry to payroll

Mark work-time entry as reported to payroll by setting its reported_at timestamp, or mark it as not reported to payroll by setting its reported_at to null. Reported entries are locked for edit.

Examples

{"reported_at":1740649659}
{"reported_at":true}
{"reported_at":null}

Params

Param name Description
reported_at
optional

Timestamp, in Unix time format. Pass true to use current time. Pass null to erase reported_at timestamp.

Validations:

  • Must be a String


GET /api/work_time_entries/types/for_user/:user_id
Get available worktime types

Examples

["regular","remote","on_call","travel","training","staggered","travel_off_hours"]

Params

Param name Description
user_id
required

Validations:

  • Must be a Integer


GET /api/work_time_entries/daily_stats
Get work time stats for a user with a daily breakdown

Get work time stats for a user with a daily breakdown for a given date range.

Stats will include:

  • date
  • actual (logged) work time, in minutes
  • mandatory working time, in minutes
  • absence time, in minutes
  • flex absence time, in minutes — only present when the user's effective LAT set contains a flex_leave type
  • paid overtime time, in minutes — only present when the user's work-time group has allow_paid_overtime; excluded from work_time_balance
  • work time balance, in minutes — actual − paid_overtime − mandatory
  • is the date locked, boolean

Permissions. User's work time balance can be accessed by:

  • user themselves
  • user's approvers
  • company's HR

Examples

[
   {
    "date": "2025-03-25",
    "actual_worked_time": 900,
    "mandatory_working_time": 450,
    "absence_time": 0,
    "paid_overtime_time": 450,
    "work_time_balance": 0,
    "is_locked": false
  },
  {
    "date": "2025-03-26",
    "actual_worked_time": 0,
    "mandatory_working_time": 450,
    "absence_time": 0,
    "work_time_balance": -450,
    "is_locked": true
  }
]

Params

Param name Description
user_id
optional

User ID. Default: current user ID.

Validations:

  • Must be a Integer

start_date
optional

Date to start the balance calculations from. Default: date of the user’s first time entry. If start date has not been passed explicitly and user has no time entries, time balance will not be calculated.

Validations:

  • Must be a String

end_date
optional

Date to end the balance calculations with, inclusive. Default: today.

Validations:

  • Must be a String

date_range
optional

Get stats within the specified date range.Either pass date_range or start/end dates. Date range format: "DD/MM/YYYY - DD/MM/YYYY" (e.g. 15/02/2025 - 28/02/2025).

Validations:

  • Must be a String


GET /api/work_time_entries/new/defaults
Get attributes to prefill a new entry with

  • If current user has no work-time entries for the date, responds with start_time, end_time, and total_break_minutes.
  • If current user already has entries for the date, responds with start_time only.
  • If more than one extra-time type is available to the user (any two of flex, paid_overtime, time_bank), also adds remaining_work_minutes and extra_time_options (the list of available types) so the client can let the user choose how overtime is treated.
  • Responds with {} if defaults cannot be calculated.

Errors

Code Description
422 Date param is invalid.

Examples

{
  "start_time": "2025-12-31T06:30:00.000Z",
  "end_time": "2025-12-31T15:30:00.000Z",
  "total_break_minutes": 60,
  "remaining_work_minutes": 450,
  "extra_time_options": ["flex", "paid_overtime"]
}

Params

Param name Description
date
optional

Date, e.g. "2025-12-31". Defaults to current date (in Europe/Helsinki timezone).

Validations:

  • Must be a String