/v2/api/entity base and authenticated with a Bearer token.1) is the data level — how deeply related records are loaded — not a page number. Pagination is controlled by the page and per_page query parameters.status query parameter; when it is omitted the request is redirected so that status=all is applied by default.| Parameter | Purpose |
|---|---|
page | Page number (default 1). |
per_page | Items per page (default 20). |
status | Approval tab to list. One of all, pending, approved, rejected, pending_on_me. Defaults to all. |
filter[<field>][<operator>] | Filter by a field, e.g. filter[staff_id][equal]=1. |
sort[<field>] | Sort by a field, asc or desc. |
fields[] | Restrict the returned columns. |
search | Free-text search. |
filter[<field>][<operator>]=<value>. The fields intended for filtering:| Field | Type | Example |
|---|---|---|
id | integer | filter[id][equal]=5 |
staff_id | integer (staff) | filter[staff_id][equal]=1 |
type | enum (leave, half_leave, delay, early) | filter[type][equal]=leave |
date_from | date | filter[date_from][greater_than_equal]=2026-01-01 |
date_to | date | filter[date_to][less_than_equal]=2026-12-31 |
created | datetime | filter[created][greater_than_equal]=2026-01-01 |
approved_by | integer (staff) | filter[approved_by][equal]=3 |
shift_type | enum (primary, secondary) | filter[shift_type][equal]=primary |
status tab parameter (above), not filter[status]. In practice the endpoint accepts a filter on any existing column.sort[<field>]=asc|desc. The field intended for sorting:| Field | Type | Example |
|---|---|---|
created | datetime | sort[created]=desc |
sort is given, results are returned newest-first (by id, descending). In practice the endpoint accepts a sort on any existing field.data is a leave-application record. Which staff members' applications are returned depends on the caller's leave permissions (own applications, or those they may view/approve for others).curl --location --globoff 'https://.daftara.com/v2/api/entity/leave_application/list/1?page=undefined&per_page=undefined&status=undefined' \
--header 'Accept: application/json' \
--header 'apikey: ' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json'{
"current_page": 1,
"data": [
{
"id": 0,
"staff_id": 0,
"type": "string",
"leave_type_id": 0,
"date_from": "string",
"date_to": "string",
"days": 0,
"late_time": 0,
"early_time": 0,
"status": "string",
"description": "string",
"created_by": 0
}
],
"per_page": 20,
"total": 0,
"last_page": 0,
"from": 0,
"to": 0,
"first_page_url": "string",
"last_page_url": "string",
"next_page_url": "string",
"prev_page_url": "string",
"path": "string",
"links": [
{}
]
}