{ID} path segment. This is a v2 native-entity endpoint served from the /v2/api/entity base and authenticated with a Bearer token. The request body is a flat JSON object of leave-application fields.date_to must equal date_from + (days − 1) and be on or after date_from. Conditional requirements follow type exactly as on create:type | Meaning | Additionally required |
|---|---|---|
leave | Leave | leave_type_id |
half_leave | Half (½) Leave | leave_type_id |
delay | Late Arrival | late_time |
early | Early Leave | early_time |
status (moved by the approval workflow, not this endpoint), approved_by, created_by and the approval-cycle fields. The comment field can only be set when the application is created — it is not editable here (send it on create instead). On success the standard native-entity { message, id } envelope is returned.Known issue (dev): the update pipeline currently faults and returns HTTP 500 {"message":"Server Error"}for this entity (the target row is left unchanged) — see the audit report. The contract below is the intended one.
curl --location --globoff --request PUT 'https://.daftara.com/v2/api/entity/leave_application/3' \
--header 'Accept: application/json' \
--header 'apikey: ' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "3",
"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 Updated Successfully",
"id": 11
}