Skip to navigation

Approve or Reject Leave Request

Approves or rejects one pending leave request of a staff member. Shared rules: see Writing data. No Payroll plan is needed.

  • Find the request with List Leave Requests (GET /requests/leave). Send its from_date.
  • Only pending requests can be decided. Revoke is not available.
  • action is APPROVE or REJECT. reason is optional, at max 500 characters, trimmed.
  • status in the response is approved, declined, or pending when a multi-level approval flow still needs a later level. An Admin’s approval finishes all levels. A reject ends the request.
  • Approving overwrites attendance on those dates, uses leave balance, recalculates payroll for them, and notifies the staff member.
  • If no pending request matches from_date, the response is 404 “Leave request not found.” If more than one pending request starts that day, the response is 400 on from_date (“Decide them in the SalaryBox app.”). Approving after salary is finalised gives 400 “Cannot modify leave request after finalizing salary.” You cannot decide your own request (400 on salarybox_id). A request that is not pending at your approval level gives 403.
  • Repeating the request after it succeeded returns 404, which is harmless.

Authentication

AuthorizationApi-Key

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

Path parameters

salarybox_idstringRequired
SalaryBox ID of the staff member who raised the request.

Request

This endpoint expects an object.
from_datedateRequired

YYYY-MM-DD. The from_date of the pending request.

actionenumRequired
Allowed values:
reasonstringOptional1-500 characters

Response

The decision was saved.
messagestringOptional
statusbooleanOptional
dataobjectOptional

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error