---
title: "Patch time off"
method: PATCH
path: "/time-off/{id}"
tags: ["time-off"]
---

# Patch time off

`PATCH /time-off/{id}`

## Request

- Base URL: `https://api.hoorayhr.io`
- URL: `https://api.hoorayhr.io/time-off/{id}`
- Auth: API key in header `authorization`

Updates the resource identified by id using data.

## Path parameters

- `id` integer, required

## Request body

- object
  - `status` integer

## Response `200`

success

- TimeOff
  - `id` integer: ID of the time-off item
  - `userId` integer, required: Unique id of the user.
  - `isPrivate` integer: Tiny-int indicating if the time-off item is private
  - `budgetCalculated` integer: The calculated time for a time-off item in hours
  - `budgetAdjustment` integer: When the time-off item is a mutation, this value indicates the amount of time that should be subtracted or added to the user's budget. Time in hours.
  - `budgetTotal` integer: The total time-off budget of a user in hours for this year
  - `isNotCalculated` integer: Tiny-int indicating if the time should be subtracted from the user's budget
  - `notes` string, long-text, nullable: Optional text field for mentioning a reason for the time-off request
  - `start` string, date-time, required: Start date and time of the time-off in JS DateTime format
  - `end` string, date-time, required: End date and time of the time-off in JS DateTime format
  - `pause` integer, nullable: Applies to hours module only. Pause time in minutes
  - `tags` object[], nullable: Applies to hours module only. Stringified array of hour tags
    - `id` integer
    - `name` string
    - `archived` boolean, nullable
  - `status` integer: Status of the time-off item. 1 = "REQUESTED", 2 = "DENIED", 3 = "APPROVED", 4 = "WITHDRAWN"
  - `leaveTypeId` integer, nullable: ID of the corresponding leave type. Can be `null` in case of holidays
  - `leaveTypeRuleId` integer, nullable: ID of the corresponding leave type rule. Can be `null` if item does not correspond to a specific rule.
  - `timeOffType` 'HOLIDAY' | 'LEAVE' | 'OVERTIME_NONE' | 'OVERTIME_PAYOUT' | 'OVERTIME_TIME_OFF_IN_LIEU' | 'TRANSACTION_SPENT' | 'TRANSACTION_LEGACY' | 'TRANSACTION_CORRECTION', required: Enum describing the type of time off item.
  - `leaveUnit` 'PARTIAL_DAY' | 'FULL_DAY' | 'HALF_DAY' | 'MULTIPLE_DAYS': The unit of the time off item
  - `integrationCategoryId` integer, nullable: ID of the integration category associated with the time-off item.
  - `holidayId` integer, nullable: If the time-off item was created from a holiday, this value indicates the id of the holiday
  - `labelIds` integer[], nullable: List of id's belonging to labels
  - `labels` Labels[]: **DEPRECATION NOTICE**: The object variant (containing the translated name per locale) for labels is deprecated and will be removed in the future. Use the simple string variant instead. Switching to the new string variant can be done by providing `useTranslatedLabels=true` as query parameter.
    - `id` integer: ID of the label
    - `documentCategoryId` integer, nullable: ID of the parent document category
    - `workflowCategoryId` integer, nullable: ID of the parent workflow category
    - `name` union, required: Either an object containing the translated name per locale or a simple string with name of the label. **DEPRECATION NOTICE**: The object variant (containing the translated name per locale) for labels is deprecated and will be removed in the future. Use the simple string variant instead. Switching to the new string variant can be done by providing `useTranslatedLabels=true` as query parameter.
      - string: Only for requests providing `useTranslatedLabels=true` as query parameter
      - object: Only for requests that do not provide `useTranslatedLabels=true` as query parameter
    - `type` 'ASSETS' | 'CONTRACTS' | 'DOCUMENTS' | 'EXPENSE_CLAIMS' | 'HOURS' | 'LEAVE' | 'SICK_LEAVE_PHASE' | 'TIME_TRACKING' | 'TRAVEL_EXPENSES' | 'WORKFLOWS', required: Enum of the service the label is assigned to
    - `systemCategoryType` 'car' | 'computer' | 'key' | 'tablet' | 'cell phone' | 'license' | 'fixed-term' | 'internship' | 'permanent' | 'parking costs' | 'food and drinks' | 'promotional gift' | 'office supplies' | 'cost of studies' | 'travel expenses' | 'commuting' | 'customer visit' | 'conference', nullable: System pre-defined labels get type
    - `archivedAt` string, date-time, nullable: Timestamp of label being archived
    - `createdAt` string, date-time: Creation date of the label
    - `updatedAt` string, date-time: Last updated date of the label
    - `deletedAt` string, date-time, nullable: Deleted date of the label
  - `timezone` string, required: The time zone of the time-off item. This will automatically be set to the time zone of the provided user through the "userId" field. Use the [time-zones](#/time-zones/get_time_zones) endpoint to fetch all supported timezones.
  - `createdAt` string, date-time: Creation date of the time-off item
  - `updatedAt` string, date-time: Last updated date of the time-off item
  - `userIdApproved` integer, nullable: Unique ID of the user that approved the time-off item
  - `reply` string, long-text, nullable: Optional text with reason for approval/denial of the time-off request

## Other responses

- `401`: not authenticated
- `404`: not found
- `500`: general error

---

[API](https://skmtc.dev/hoorayhr/apis/hoorayhr-api-documentation.md) · [All operations](https://skmtc.dev/hoorayhr/apis/hoorayhr-api-documentation/llms.txt) · [OpenAPI document](https://skmtc.dev/hoorayhr/apis/hoorayhr-api-documentation/revisions/3adcd47cd827?raw)
