---
title: "Updates the absence with the specified id."
method: PUT
path: "/absences/{absenceId}"
tags: ["absences"]
---

# Updates the absence with the specified id.

`PUT /absences/{absenceId}`

The startOn and endOn get rounded to 00:00:00, 12:00:00, or 23:59:59 in UTC.
             These values can be used to set a half-day (pre or post mid-day) absence, or absences that start or end at mid-day.
             The end date needs to be the same or after the start date.
            
             <Check title="Required Permissions" icon="key">User planning data permissions are required if the calling user is not the owner of the absence or admin.</Check>

## Path parameters

- `absenceId` string, uuid, required

## Headers

- `Authorization` string, required

## Request body

- AbsenceForm
  - `userId` string, uuid, required — The id of the user to create the absence for.
  - `startOn` string, date-time — The start time of the absence. The time of the date will be ignored.
  - `endOn` string, date-time — The end time of the absence. The time of the date will be ignored.
  - `description` string, nullable — The reason for the absence.
  - `externalProvider` string, nullable — The external provider for the absence. If this value is set, the absence is treated as externally managed and therefore read-only in awork. This means users in awork can no longer edit or delete the absence.
  - `isHalfDayOnStart` boolean — If it's true and it's a single day absence means that the absence to create is for the first half of the workday. If it's a multi day absence it started on the second half of the first day of the absence period.
  - `isHalfDayOnEnd` boolean — If it's true and it's a single day absence means that the absence to create is for the second half of the workday. If it's a multi day absence it ended on the first half of the last day of the absence period.
  - `isSingleDayAbsence` boolean

## Response `200`

OK

- Absence
  - `id` string, uuid — The id of the entity.
  - `createdOn` string, date-time — The date this entity was created.
  - `createdBy` string, uuid — The id of the user who created this entity.
  - `updatedOn` string, date-time — The date this entity was last modified.
  - `updatedBy` string, uuid — The id of the user who last modified this entity.
  - `userId` string, uuid, nullable — The id of the user to create the absence for.
  - `startOn` string, date-time — The start time of the absence.
  - `endOn` string, date-time — The end time of the absence.
  - `description` string, nullable — The reason for the absence.
  - `externalProvider` string, nullable — The external provider for the absence. If this value is set, the absence is treated as externally managed and therefore read-only in awork. This means users in awork can no longer edit or delete the absence.
  - `deletedOn` string, date-time, nullable — The date the absence was deleted.
  - `deletedBy` string, uuid, nullable — The id of the user that deleted the absence.
  - `isReadOnly` boolean — If it's true it means that this Absence is read-only and cannot be edited/deleted by the user.
  - `isHalfDayOnStart` boolean — If it's true and it's a single day absence means that the absence is for the first half of the workday. If it's a multi day absence it started on the second half of the first day of the absence period.
  - `isHalfDayOnEnd` boolean — If it's true and it's a single day absence means that the absence is for the second half of the workday. If it's a multi day absence it ended on the first half of the last day of the absence period.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized

---

[API](https://skmtc.net/awork-io/apis/api-v1-reference.md) · [All operations](https://skmtc.net/awork-io/apis/api-v1-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/awork-io/api-v1-reference/versions/f784a53f60df/schema)
