Skip to navigation

Add Staff Leave Policy

Sets how much leave one staff member is given, per leave type. It does not change their current balance (use PUT /leave/balance for that). Only the leave types sent change. Shared rules: see Writing data.

  • salarybox_id is an active staff member of the company.
  • policies 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.
  • allocation_cycle is MONTHLY or ANNUAL.
  • total_allotted_leaves is 0-366 with up to 3 decimals; at most 31 when MONTHLY.
  • carry_forward_leaves is optional, 0-366 with up to 3 decimals. Left out, it stays as it is (0 for a new policy).
  • Every policy write needs the Leave Carry Forward plan feature, as in the app; otherwise 403 with the plan’s upgrade message.
  • 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.
policieslist of objectsRequired
One item per leave type, each leave type at most once.

Response

The leave policy was saved.
messagestringOptional
statusbooleanOptional
dataobjectOptional

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error