PeopleForce
Leaves

Early access

Company API v4 is the next-generation API and is under active development. Endpoints and fields may still change.

List all leave requests

Returns a list of leave requests for every person the service account can see

GET
/api/v4/leave_requests

Returns a list of leave requests for every person the service account can see

Query Parameters

page?integer

Page offset to fetch.

Formatint32
Default1
per_page?integer

Number of results to return per page.

Formatint32
Default100
offset?integer

Pad a number of results.

Formatint32
Default0
employee_ids?array<>

Filter by employee IDs. e.g., employee_ids[]=1&employee_ids[]=2

states?array<>

Filter by state. Allowed values: pending, approved, rejected, withdrawn

starts_on?string

Filter leave request starting on or after this date (YYYY-MM-DD)

Formatdate
ends_on?string

Filter leave request ending on or after this date (YYYY-MM-DD)

Formatdate
created_at[gt]?string

created_at after an ISO 8601 timestamp with timezone

Formatdate-time
created_at[gte]?string

created_at on or after an ISO 8601 timestamp with timezone

Formatdate-time
created_at[lt]?string

created_at before an ISO 8601 timestamp with timezone

Formatdate-time
created_at[lte]?string

created_at on or before an ISO 8601 timestamp with timezone

Formatdate-time
updated_at[gt]?string

updated_at after an ISO 8601 timestamp with timezone

Formatdate-time
updated_at[gte]?string

updated_at on or after an ISO 8601 timestamp with timezone

Formatdate-time
updated_at[lt]?string

updated_at before an ISO 8601 timestamp with timezone

Formatdate-time
updated_at[lte]?string

updated_at on or before an ISO 8601 timestamp with timezone

Formatdate-time

Response Body

application/json

curl -X GET "https://example.com/api/v4/leave_requests"
{  "data": [    {      "id": "string",      "employee_id": 0,      "leave_type_id": 0,      "leave_type": "string",      "state": "string",      "amount": 0.1,      "hours": 0.1,      "tracking_time_in": "string",      "on_demand": true,      "starts_on": "2019-08-24",      "ends_on": "2019-08-24",      "comment": "string",      "created_at": null,      "updated_at": null,      "employee": {        "id": 0,        "first_name": "string",        "last_name": "string",        "email": "string",        "type": "string"      },      "attachments": {        "filename": "string",        "url": "string",        "expires_at": null      },      "entries": {        "date": "2019-08-24",        "amount": 0.1,        "starts_at": null,        "ends_at": null      },      "leave_type_policy": {        "name": "string",        "visibility": "string",        "activity_type": "string"      },      "approvals": {        "state": "string",        "assigned_to": {          "id": 0,          "first_name": "string",          "last_name": "string",          "email": "string",          "type": "string"        }      }    }  ],  "metadata": {    "page": 0,    "per_page": 0,    "total_pages": 0,    "total_count": 0  }}