Skip to main content
Call this API to create a leave rule.

API Call Description

This API creates two types of leave rules:
  • General leave rules, such as personal leave and marriage leave. The balance of these rules can be modified. After you create a general leave rule with this API, the balance defaults to 0. Call the Initialize Leave Balance API to initialize the leave balance.
  • Compensatory leave rules. For compensatory leave added with this API, the default balance rule is Overtime duration automatically counts toward the compensatory leave balance. You do not need to call the balance initialization API.
The equivalent settings in the DingTalk Admin Console are under Leave Management > Leave Rules. Click Add Leave to open the New Leave dialog, which contains these fields: The Leave Duration Calculation Rules section groups the Minimum Leave Unit and Leave Duration Calculation settings. Click Save to create the rule.

Request

Basic Information

Request Header

Query Parameters

Request Body

Request Example

HTTP
Java
Python
PHP
Go
Node.js
C#

Response

Response Body

Response Body Example

Error Codes

If a call to this API fails, find a solution in the Global Error Codes document based on the error message.