Skip to Content
Z8Z8 Docs

List work periods

GET
/api/v1/work-periods

Recorded work, one period from clock-in to clock-out, in its current state: approved corrections are applied, and raw time entries and correction history are not returned. Rejected and deleted work is left out. Running work is included with no end.

Each endpoint is a UTC instant with the UTC offset where it was recorded. A break is the time between two consecutive work periods of an employee.

from and to select periods by their start instant.

Requires the key scope time-entries:read.

Authorization

apiKey
headerAuthorizationBearer <token>

An organization API key (starts with z8_org).

Query Parameters

from*string

Start of the range, inclusive. An ISO 8601 instant with offset or Z.

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])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
Formatdate-time
to*string

End of the range, exclusive. 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])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
Formatdate-time
employeeId?string

Only this employee's work.

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
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/work-periods?from=2019-08-24T14%3A15%3A22Z&to=2019-08-24T14%3A15%3A22Z'
Example Response
{  "data": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "employeeId": "b0e78c8f-8c8b-4410-8293-9239e39d9e17",      "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8",      "start": {        "at": "2019-08-24T14:15:22Z",        "utcOffset": "string"      },      "end": {        "at": "2019-08-24T14:15:22Z",        "utcOffset": "string"      },      "durationMinutes": -9007199254740991,      "approvalStatus": "approved",      "vehicleUse": {        "kind": "organization",        "vehicleId": "c406adf4-e700-4483-ad7a-e7447a2941cb",        "vehicleName": "string",        "licencePlate": "string",        "odometerStartKm": 0,        "odometerEndKm": 0,        "drivenDistanceKm": 0      }    }  ],  "nextCursor": "string"}