---
title: "Update an attendance for a given attendance id."
method: PUT
path: "/attendances/{attendanceId}"
tags: ["Attendance"]
---

# Update an attendance for a given attendance id.

`PUT /attendances/{attendanceId}`

Updates the attendance entry specified by **attendanceId**. Only the fields sent in the body are updated.
**Overnight:** When updating **endTime** to a time on the next calendar day (e.g. changing an open entry to close at 06:00 next day), send **endTime** = `06:00:00` and **isOvernightShift** = `true`. 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."*
**Same-day rule:** When **isOvernightShift** is not set or is `false`, **endTime** must be after **startTime** (same calendar day). If you send an end time earlier than start time (e.g. 22:00 start and 06:00 end) without **isOvernightShift** = `true`, the API 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."*

## Path parameters

- `attendanceId` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `startTime` string — The new start time of the attendance entry to update. The valid format is *hh:mm:ss*
  - `endTime` string — The new end time. Format *hh:mm:ss*. For overnight (end time next calendar day), also set **isOvernightShift** to `true`. When **isOvernightShift** is true, **endTime** must be at or before 18:00.
  - `isOvernightShift` boolean — Optional. When `true`, **endTime** is interpreted as the time on the *next* calendar day (relative to the entry's date). Use when updating an entry to close as overnight. **endTime** cannot be later than 18:00. Default `false`.
  - `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.<br> - There is no way to update specifically a break.<br> - To remove 'breaks', just send an empty array in the update, something like "breaks":[]
    - `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 `200`

OK

- object
  - `_id` string — The _id of the requested attendance entry.
  - `userId` string — The id of the employee associated to the requested attendance entry.
  - `email` string — The email of the employee associated to the requested attendance entry.
  - `externalId` string — The external Id of the employee associated to the requested attendance entry.
  - `startTime` string — The start date time of the requested attendance entry.
  - `endTime` string — The end date time of the requested attendance entry.
  - `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)
