v1

latestOpenAPI 3.0.02026-07-14800227.2 KB
Time off

Set the balance (available balance) of a time off type for a specific employee.

This endpoint allows you to set (adjust) the balance of a time off type for a specific employee. The balance adjustment will be recorded in the time off history with a description of the change.

The employee must be assigned to the specified time off type for the operation to succeed. Balance values can be positive or negative.

put/time-off/set-balance/{timeOffTypeId}/{employeeId}

Path parameters

timeOffTypeIdstring required
Example:507f1f77bcf86cd799439011

The unique identifier of the time off type (MongoDB ObjectId).

employeeIdstring required
Example:507f191e810c19729de860ea

The unique identifier of the employee (MongoDB ObjectId).

Headers

Authorizationstring required
Example:Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5rZW5qby5pbyIsInN1YiI6IjYwZjBhOTE2MjE0OTg3MjU2YmU5YzhmZiIsImF1ZCI6Imh0dHBzOi8vYXBpLmtlbmpvLmlvIiwiaWF0IjoxNjI2Mzg1MTE1LCJuYmYiOjE2MjYzODUxMTUsImV4cCI6MTYyNjU1NzkxNSwiYWNjZXNzVHlwZSI6IkFwaUFjY2VzcyIsInNfb3JnSWQiOiI2MGYwNGVhN2RmN2JhMjFlY2U0YmYzYzIifQ.cxG_7dIS-VbmDXdJuLkekoyuyCIzQG2fMcgc0nkfbWE8cihhcb5FnALbQkjU9b5-qVcEoMHZlSuUA-jMEBMMVQ

A valid bearer token.

Request body

balancenumber required

Enter the new balance (remaining days or hours) for the selected time off type. This sets how much time off the employee should have left to use. The system will automatically adjust the overall totalAllowance (total granted) so that, after subtracting time already taken, the balance matches what you set. For example, if the employee has already taken 4 days, and you set the balance to 10, the allowance will be updated to 14. Also, note that any planned (not yet taken) time off is automatically subtracted from this balance to show the true available amount. For instance, if there are 4 planned days and you set the balance to 10, the available balance will be 6.

descriptionstring

Optional description explaining the reason for the balance adjustment (max 1000 characters).

Example request

{
  "balance": 15,
  "description": "Year-end balance adjustment"
}

Response

OK. The balance has been successfully adjusted.

object required

Example response

{}