Skip to navigation

Update Staff Leave Balance

Sets one staff member’s current leave balance, per leave type. Only the leave types sent change. Shared rules: see Writing data.

  • salarybox_id is an active staff member of the company.
  • balances has at max 50 items, each leave type at most once. leave_type is the exact leave type name (case-sensitive) from GET /leave/balance or GET /leave/policy; system leave types are refused.
  • pending_leaves is the remaining balance, from -366 to 366 with up to 3 decimals. It replaces the current balance, it is not added to it. A negative balance is allowed.
  • carry_forwarded_leaves is optional, 0-366 with up to 3 decimals. Left out, it stays as it is. Sending a non-zero value needs the Leave Carry Forward plan feature; balances alone work on every plan.
  • A leave type that already has a balance must have a leave policy first (POST /leave/policy), otherwise 400. A new balance row on a staff member with no policy gets an ANNUAL policy with 0 allotted.
  • Numbers must be JSON numbers, not strings. Repeating the request is safe: it sets the same values.

Authentication

AuthorizationApi-Key

Format: “Api-Key {api-key}”

Request

This endpoint expects an object.
salarybox_idstringRequired1-50 characters
SalaryBox ID of an active staff member.
balanceslist of objectsRequired
One item per leave type, each leave type at most once.

Response

The leave balance was saved.
messagestringOptional
statusbooleanOptional
dataobjectOptional

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error