addTimeRecord, adjust it, clone a full week with cloneTimeRecords, and submit the period with submitTimesheet. Every duration in Beebole is expressed in milliseconds.
These are write operations — they create and change data. For read-only reporting, see Export a month of time records.
Step 1 — Log a time entry
addTimeRecord creates one logged entry for a person on a given day. The required arguments are startTime (a Unix timestamp in milliseconds), duration (milliseconds), and personId. Pass taskId, absenceId, or projectIds to link the entry. Here the call logs 2 hours against a task.
Durations are in milliseconds. To log 2 hours, pass
7200000 (2 × 60 × 60 × 1000), not 120 and not 2.id:
id: the edit mutations in the next step need it.
Step 2 — Adjust the entry
Each editable field has its own mutation. To correct the logged duration, calleditTimeRecordDuration with the record id and the new millisecond value. This changes the entry from 2 hours to 3 hours (10800000 ms):
editTimeRecordDay, editTimeRecordStartTime, editTimeRecordEndTime, editTimeRecordProjects, editTimeRecordTask, editTimeRecordAbsence, editTimeRecordComment, editTimeRecordNonBillable, and editTimeRecordWfh. Each takes the record id plus the one value to change and returns the updated record.
Step 3 — Clone a full week
When a person’s week repeats a regular pattern,cloneTimeRecords copies their entries from a source period to a target period in one call. Set replaceExisting: true to clear the target period before cloning. Each period runs from midnight UTC of its first day to the last millisecond of its last day, here June 1 to 7 copied onto June 8 to 14, 2024:
Step 4 — Submit the timesheet
Once the period is complete,submitTimesheet sends it into the approval workflow. It takes the personId and the startTime / endTime of the period, and returns a submit event whose id you pass to approveTimesheet or rejectTimesheet later. Pass the period’s bounds exactly as Beebole’s timesheet sets them (midnight UTC of the first day, last millisecond of the last day), since approval status is stored per period. It refuses the period with NotAuthorisedToSubmit when the key’s owner is neither the person, an administrator, nor one of the person’s managers, NoApprovalWorkflow when no approval workflow applies to the person, timesheetPeriodLocked when the period ends on or before the lock date, and TimesheetAlreadySubmitted when it is already waiting for approval. It also applies the timesheet’s entry rules: timeRecordCommentRequired when comments are required and an entry has none, and timeRecordOvertimeDaily, timeRecordOvertimePeriod, timeRecordUndertimeDaily, or timeRecordUndertimePeriod when the logged time is above or below what the person’s schedule allows.
status field is the event’s action code, s for this submission. Other approval events carry a (approved), r (rejected), or f (auto-submit failed), and a period that nobody has submitted reads d (draft) in getApprovalState. When no stage of the person’s workflow has an approver, Beebole approves the period at once and the event comes back with a. Later, approveTimesheet works out the current stage on its own, while rejectTimesheet also takes the stage to reject and a comment.
Related content
API Introduction
Authenticate with your API key and send your first request.
Mutations
Every write operation, with full argument signatures.
Queries
Read back the records you create with these mutations.