Skip to main content
Call this API to update the rules of a specified leave type.

API Call Description

Leave rules can be created in two ways: by calling the API, or in the official DingTalk Attendance app: On the Attendance > Leave Management > Leave Rules page, view the four existing leave rules.
  • API-created leave type 1 and API-created leave type 2 were created through the API. Call this API to update their information, such as the leave name, leave request unit, leave duration calculation method, and balance scope.
  • Personal Leave and Compensatory Leave are default leave types created by the Attendance app system. This API cannot update these leave types and returns the following error message: errcode:880015,errmsg:The specified leaveCode or userId does not exist.
Call the Query Leave Rule List API to check which leave rules were created through the API.
In the DingTalk Admin Console, go to Leave Management > Leave Rules to view the list of leave rules. Click + Add Leave to create a new one. Each rule shows the following columns: In the illustrated example, the default leave types Personal Leave and Compensatory Leave are configured with “By hour” as the request unit, while the API-created leave types are configured with “By day”.

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 the API call returns an error, find a solution in the Global Error Codes document based on the error message.