---
title: "Track an attendance entry."
method: POST
path: "/attendances/track-time"
tags: ["Attendance"]
---

# Track an attendance entry.

`POST /attendances/track-time`

Tracks time by sending an **employee identifier** and a **dateTime** (format `YYYY-MM-DDThh:mm:ss`). Use **userId**, **email** or **externalId** (one required). Each call creates or updates attendance entries so that pairs (start/end) stay ordered.

**Example (same day):** T1 `2021-01-01T08:00:00`, T2 `2021-01-01T09:00:00`, T3 `2021-01-01T10:00:00` → entries 08:00/09:00 and 10:00/open. A later T4 `2021-01-01T12:00:00` closes the second pair as 10:00/12:00.

**Overnight shifts (single entry):** To close an overnight shift with one entry (e.g. started 22:00 day 1, clock-out 06:00 day 2):
1. First call: **dateTime** = start (e.g. `2026-02-03T22:00:00`). This creates an open entry on that day.
2. Second call: **dateTime** = clock-out on the *next calendar day* (e.g. `2026-02-04T06:00:00`) and **isOvernightShift** = `true`. The API closes the previous day's open entry with end time 06:00 next day (one overnight entry). You *must* send the actual next calendar day in **dateTime** (e.g. 04, not 03) so the system finds the open entry on the previous day. The clock-out time can be from **00:00 up to 18:00 inclusive** on the next day; within that range, the previous day's open entry is closed. If you send a time after 18:00 (e.g. 18:01 or 12:00 next day), the punch is treated as a new entry on the current day instead of closing the overnight.

## 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.
  - `dateTime` string, required — Date and time in format `YYYY-MM-DDThh:mm:ss`. For overnight clock-out with **isOvernightShift** true, use the *next calendar day* with a time between 00:00 and 18:00 inclusive (e.g. `2026-02-04T06:00:00` to close a shift that started `2026-02-03T22:00:00`).
  - `isOvernightShift` boolean — Optional. When `true` and **dateTime** is between **00:00 and 18:00 (inclusive)** on the next calendar day, this punch is treated as the *clock-out* of an overnight shift: the API looks for an open entry on the *previous* calendar day and closes it with that end time (single overnight entry). Times after 18:00 are treated as a new punch on the current day, not as closing the overnight. **Important:** Send **dateTime** with the actual next calendar day (e.g. `2026-02-04T06:00:00`), not the same day as the start. Default `false`.

## Response `201`

CREATED. The returned body matches the input 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.
  - `dateTime` string, required — The date and the time of the Kenjo employee in format YYYY-MM-DDThh:mm:ss.

## 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)
