v1

latestOpenAPI 3.1.0Apache 2.02026-07-22160175414.0 KB
Workflow

Submit timesheets

Submit all timesheets for an owner up to the given period, or to the last submittable timesheet.

The response contains all affected timesheets, with a feedback about each item's status, subsequent to the submission action :

  • success when the timesheet is submitted successfully.
  • noAction if the timesheet has already been submitted.
  • error in case of an error.

Timesheets are created and their status are set to submitted. In some cases, timesheets may then be automatically approved, depending on the approval workflow settings.

Once submitted, all timeentries on the period for that user can no longer be modified. In order to be able to modify them, the timesheet must first be rejected through cancel, deny or invalidate operations (depends on the current timesheet status).

If you have set up account transfer authorizations in Lucca Timesheet, and need to adjust them before submitting timesheets, only the timesheet containing itself the startsAt date you set will be associated with the Transfer provided (i.e. the last timesheet).

If you need to handle account transfer authorizations, we strongly suggest to do as many requests as there are timesheets to submit for a given owner, in chronological order, so that you can provide each timesheet its corresponding Transfer.

Please see this guide on how to submit Timesheets the right way.

post/timmi-timesheet/api/timesheets/submit

Request body

ownerIdinteger required

Reference to the owner of submittable timesheets.

startsAtstring date-time required

First day of the last timesheet to submit.

endsAtstring date-time

Last day of the last timesheet to submit. Optional.

Example request

{
  "startsAt": "2024-05-27T00:00:00",
  "endsAt": "2024-07-01T00:00:00",
  "transfers": [
    {
      "amount": {
        "iso": "PT7H30M"
      }
    }
  ]
}

Response

OK

idinteger

Unique id of the WorkflowItem.

exceptionMessagestring

Any human readable error message.

startsOnstring date

The Timesheet the WorkflowItem is related on starting date (included).

endsOnstring date

The Timesheet the WorkflowItem is related on ending date (excluded).

expectedNextActorobject

A Directory 'User'. See API reference for up-to-date attributes.

statusstring
  • "success" for a succesfull workflow operation.
  • "error" if any error was met, and therefore an excetion message is set.
  • "noAction" if the workflow operation was not performed.