Skip to main content
Call this API to batch update total leave balance information.

API Call Description

This API updates a leave balance by adding to or subtracting from the existing balance. It does not affect the leave quota that the employee has already used. The following example illustrates the process:
  1. Call the Add leave rules API to create a standard leave type. Then call the Initialize leave balance API to set the initial balance to 8 days.
  2. Call this API to update John’s leave balance with quota_num_per_day set to 900. The resulting record adds 1 day to the existing balance.
  3. John submits a leave request Approval form of this leave type in DingTalk for 2 days. A record that deducts 2 days is generated.
  4. Call this API to update John’s leave balance with quota_num_per_day set to 1000. The resulting record adds 1 day, and the final balance is 8 days. In the Admin Console, leave management in the Attendance app includes Leave rules, Employee leave balance, Leave approval settings, and Leave record export. On the Employee leave balance page, Export or Batch update balances, and open an employee’s record to view their leave usage history by leave type. Each usage entry shows the time, the change (for example, +5.0 days added automatically by the system according to the leave rule), the valid period, and the reason.
Leave rules can be created in 2 ways: by calling the API, or through the official DingTalk Attendance app:

Request

Query Parameters

Request Body

Request Example

Java
Python
PHP
C#

Response

Response Body

Response Body Example

Error Codes

If a call to this API returns an error, find a solution based on the error message in the Global error codes Document.