/v2/api/entity base and authenticated with a Bearer token. The request body is a flat JSON object whose keys are the leave-application fields.staff_id, date_from, date_to and days. The date range and day count must be consistent: date_to must equal date_from + (days − 1) (and be on or after date_from).type:type | Meaning | Additionally required |
|---|---|---|
leave (default) | Leave | leave_type_id |
half_leave | Half (½) Leave | leave_type_id |
delay | Late Arrival | late_time (minutes) |
early | Early Leave | early_time (minutes) |
id (assigned automatically), status (always starts as pending), approved_by, created_by (taken from the authenticated user) or the approval-cycle fields (resolved automatically). On success the endpoint returns the standard native-entity { message, id } envelope with the new leave-application id.Known issue (dev): the create pipeline currently faults and returns HTTP 500 {"message":"Server Error"}for this entity — see the audit report. The request contract below is the intended one.
curl --location --globoff 'https://.daftara.com/v2/api/entity/leave_application' \
--header 'Accept: application/json' \
--header 'apikey: ' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "",
"staff_id": "1",
"days": "43",
"date_from": "2026-11-17",
"date_to": "2026-12-29",
"type": "leave",
"leave_type_id": "1",
"late_time": "",
"early_time": "",
"description": "",
"attachments": ""
}'{
"message": "Leave Application Added Successfully",
"id": 11
}