Skip to Content
Z8Z8 Docs

List absences

GET
/api/v1/absences

Approved and pending absences that overlap the from/to range, each with its status. Rejected and cancelled absences are left out.

Dates are local calendar dates with the half day where one applies; they are never instants.

Health detail: without the key scope absences:read-health, a sick absence is returned as absent, with no category and no sick detail.

Requires the key scope absences:read.

Authorization

apiKey
headerAuthorizationBearer <token>

An organization API key (starts with z8_org).

Query Parameters

from*string

First day of the range, inclusive (YYYY-MM-DD).

Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
Formatdate
to*string

Last day of the range, inclusive (YYYY-MM-DD). At most 366 days after from.

Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
Formatdate
employeeId?string

Only this employee's absences.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
status?string

Only absences with this status.

Value in"approved""pending"
limit?integer

Rows per page, 1 to 200.

Range1 <= value <= 200
Default50
cursor?string

The nextCursor of the previous page. Omit it for the first page.

Length1 <= length <= 1024

Response Body

OK

application/json
  1. response
data*array<>
nextCursor*|

Pass as cursor to read the next page; null on the last page.

Example Request
curl -X GET 'https://ui.z8-time.app/api/v1/absences?from=2019-08-24&to=2019-08-24'
Example Response
{  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "employeeId": "b0e78c8f-8c8b-4410-8293-9239e39d9e17",      "status": "approved",      "startDate": "2019-08-24",      "startPeriod": "full_day",      "endDate": "2019-08-24",      "endPeriod": "full_day",      "type": "home_office",      "category": {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "name": "string"      },      "sickDetail": "child_sick"    }  ],  "nextCursor": "string"}