---
title: "Create a new attendance."
method: POST
path: "/attendances"
tags: ["Attendance"]
---

# Create a new attendance.

`POST /attendances`

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."*

## Headers

- `Authorization` string, required

## Request body

- object
  - `userId` string — The Kenjo employee *_id*.
  - `email` string — The Kenjo *email* for an employee.
  - `externalId` string — The *external id* for an employee for integrations.
  - `date` string, required — The date of the entry. The valid format is *YYYY-MM-DD*. Required field.
  - `startTime` string, required — The start time of the entry. The valid format is *hh:mm:ss*. Required field.
  - `endTime` string — 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).
  - `isOvernightShift` boolean — 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.
  - `breaks` object[] — Array that contains the breaks in detail. Rules:<br> - A maximum of 10 breaks can be loaded via API.<br> - Breaks cannot be overlapped in the same day.<br> - 'start' field is required.
    - `start` string — The start time of the break. This field is required if 'breaks' is added to the body. The valid format is *hh:mm:ss*
    - `end` string — The end time of the break. This field is required if 'breaks' is added to the body. The valid format is *hh:mm:ss*
  - `comment` string — Optional text to describe an attendance record (pair of startTime and endTime). The maximum number of characters is 150.

## Response `201`

CREATED

- object
  - `_id` string — The Kenjo _id of the new attendance entry.
  - `userId` string — The id of the employee assigned to the requested attendance entry.
  - `email` string — The email of the employee assigned to the requested attendance entry.
  - `externalId` string — The external Id of the employee assigned to the requested attendance entry.
  - `startTime` string — The start date time of the created attendance entry
  - `endTime` string — The end date time of the created attendance entry.
  - `breaks` object[] — Array that contains the breaks in detail.
    - `start` string — The start time of the break.
    - `end` string — The end time of the break.
  - `breakTime` number — 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.
  - `paidBreakTime` number — 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.
  - `comment` string — Optional text to describe an attendance record (pair of startTime and endTime). The maximum number of characters is 150.

## Other responses

- `400` — BAD REQUEST. This is a wrong request in the client side due to invalid body or params.
- `401` — UNAUTHORIZED. The Authorization header is incorrect, not provided or the token expired.

---

[API](https://skmtc.net/kenjo/apis/kenjo-api.md) · [All operations](https://skmtc.net/kenjo/apis/kenjo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kenjo/kenjo-api/revisions/58772b78268e/schema)
