v1

latestOpenAPI 3.0.02026-07-14800227.2 KB
Attendance

Create a new attendance.

This endpoint creates an attendance entry for one employee. A user identifier is required (userId, email or externalId). date and startTime are required. The new entry has a unique _id returned in the response.

Overlapping: A day accepts many attendance entries per employee but they cannot overlap. Creating an entry whose start or end falls inside an existing entry for the same day and user returns BAD REQUEST.

Overnight shifts (single entry): To create one entry for a shift that ends the next calendar day (e.g. 22:00 on Jan 1 to 06:00 on Jan 2), send date = start day (e.g. 2026-01-01), startTime = 22:00:00, endTime = 06:00:00, and isOvernightShift = true. The API stores it as one entry on the start day with end time interpreted as 06:00 next day. For overnight shifts, endTime cannot be later than 18:00; otherwise the API returns 400 with message "For overnight shifts, end time cannot be later than 18:00." If you do not use isOvernightShift, then endTime is always the same day as date; for overnight you would need two separate entries (one per day). Same-day rule: When isOvernightShift is not set or is false, endTime must be after startTime. Sending an end time earlier than or equal to start time (e.g. 22:00 start and 06:00 end) without isOvernightShift = true returns 400 with message "When isOvernightShift is not set, endTime must be after startTime. For shifts that end the next day, set isOvernightShift to true."

post/attendances

Headers

Authorizationstring required
Example:Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5rZW5qby5pbyIsInN1YiI6IjYwZjBhOTE2MjE0OTg3MjU2YmU5YzhmZiIsImF1ZCI6Imh0dHBzOi8vYXBpLmtlbmpvLmlvIiwiaWF0IjoxNjI2Mzg1MTE1LCJuYmYiOjE2MjYzODUxMTUsImV4cCI6MTYyNjU1NzkxNSwiYWNjZXNzVHlwZSI6IkFwaUFjY2VzcyIsInNfb3JnSWQiOiI2MGYwNGVhN2RmN2JhMjFlY2U0YmYzYzIifQ.cxG_7dIS-VbmDXdJuLkekoyuyCIzQG2fMcgc0nkfbWE8cihhcb5FnALbQkjU9b5-qVcEoMHZlSuUA-jMEBMMVQ

A valid bearer token.

Request body

userIdstring

The Kenjo employee _id.

emailstring

The Kenjo email for an employee.

externalIdstring

The external id for an employee for integrations.

datestring required

The date of the entry. The valid format is YYYY-MM-DD. Required field.

startTimestring required

The start time of the entry. The valid format is hh:mm:ss. Required field.

endTimestring

The end time of the entry. Format hh:mm:ss. Not required, but when present cannot be less than or equal to startTime (unless isOvernightShift is used). Overnight: If the shift ends the next calendar day (e.g. 22:00–06:00), set isOvernightShift to true and send endTime as the clock-out time (e.g. 06:00:00). The API will store it as one entry on the date day. When isOvernightShift is true, endTime cannot be later than 18:00 (returns 400 otherwise).

isOvernightShiftboolean

Optional. When true, endTime is interpreted as the time on the next calendar day after date. Use this for overnight shifts (e.g. start 22:00 on date, end 06:00 next day). endTime cannot be later than 18:00. Default false; omit or set to false for normal same-day entries.

commentstring

Optional text to describe an attendance record (pair of startTime and endTime). The maximum number of characters is 150.

Example request

{
  "userId": "50a2db290da29e126a18789a",
  "email": "john@acme.io",
  "externalId": "00001",
  "date": "2021-07-01",
  "startTime": "10:00:00",
  "endTime": "13:00:00",
  "breaks": [
    {
      "start": "11:00:00",
      "end": "11:30:00"
    }
  ],
  "comment": "Morning working attendance tracking."
}

Response

CREATED

_idstring

The Kenjo _id of the new attendance entry.

userIdstring

The id of the employee assigned to the requested attendance entry.

emailstring

The email of the employee assigned to the requested attendance entry.

externalIdstring

The external Id of the employee assigned to the requested attendance entry.

startTimestring

The start date time of the created attendance entry

endTimestring

The end date time of the created attendance entry.

breakTimenumber

DEPRECATED field, use the 'breaks' field to specify the breaktime. The time in minutes to indicate a break of time. It cannot be greater than the total of minutes reported for the attendance entry.

paidBreakTimenumber

Number of minutes of paid break time. If there is no 'paidBreakTime' this field will not be in the response. This value is the sum of the total time of paid breaks, which can be configured in the settings of the attendance policy.

commentstring

Optional text to describe an attendance record (pair of startTime and endTime). The maximum number of characters is 150.

Example response

{
  "_id": "60a2db290da29e126a18789a",
  "userId": "60a2db290da29e126a18789a",
  "email": "john@acme.io",
  "externalId": "000034",
  "startTime": "2021-07-01T10:00:00",
  "endTime": "2021-07-01T13:00:00",
  "breaks": [
    {
      "start": "11:00:00",
      "end": "11:30:00"
    }
  ],
  "breakTime": 30,
  "paidBreakTime": 30,
  "comment": "Morning working attendance tracking."
}