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."
Categories: Optional. Take the ids from GET /attendances/categories, the same fields that GET /attendances returns. A category without parentCategoryId goes in attendanceCategoryId; a sub category goes in attendanceSubCategoryId together with its parent in attendanceCategoryId. A category with active sub categories requires one of them. Both must be active and belong to your company. null in either field means none, as if the field were not sent. Otherwise the API returns 400 with one of these messages:
- "The attendanceCategoryId has active sub categories: send one of them in attendanceSubCategoryId."
- "The attendanceSubCategoryId requires the attendanceCategoryId of its parent category."
- "The attendanceCategoryId is not valid." / "The attendanceSubCategoryId is not valid." (not a Kenjo _id)
- "No attendance category found for the attendanceCategoryId." / "No attendance sub category found for the attendanceSubCategoryId."
- "The attendanceCategoryId belongs to a sub category: send it as attendanceSubCategoryId and its parent category as attendanceCategoryId."
- "The attendanceSubCategoryId does not belong to the attendanceCategoryId."
- "The attendance category is not active." / "The attendance sub category is not active."
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
401UNAUTHORIZED. The Authorization header is incorrect, not provided or the token expired.
