v1

latestOpenAPI 3.0.12026-08-041753011.2 MB
Time Off

Get all time off requests on a workspace

post/v1/workspaces/{workspaceId}/time-off/requests

Path parameters

workspaceIdstring required

Represents a workspace identifier across the system.

Example:60f91b3ffdaf031696ec61a8

Represents a workspace identifier across the system.

Request body

endstring date-time

Provide the end of the filtering period. Used with start to filter for time-off requests periods that occur (fully or partially) within this range. Both parameters must be provided for filtering to take effect. Provide end in format YYYY-MM-DDTHH:MM:SS.ssssssZ

pageinteger

Page number.

pageSizeinteger

Page size.

startstring date-time

Provide the beginning of the filtering period. Used with end to filter for time-off requests periods that occur (fully or partially) within this range. Both parameters must be provided for filtering to take effect. Provide start in format YYYY-MM-DDTHH:MM:SS.ssssssZ

statusesstring[]

Filters time off requests by status.

userGroupsstring[]

Provide the user group ids of time off requests.

usersstring[]

Provide the user ids of time off requests. If empty, will return time off requests of all users (with a maximum of 5000 users).

Example request

{
  "end": "2022-08-26T23:55:06.281873Z",
  "page": 1,
  "pageSize": 50,
  "start": "2022-08-26T08:00:06.281873Z",
  "statuses": [
    "APPROVED",
    "PENDING"
  ],
  "userGroups": [
    "5b715612b079875110791342",
    "5b715612b079875110791324",
    "5b715612b079875110793142"
  ],
  "users": [
    "5b715612b079875110791432",
    "b715612b079875110791234"
  ]
}

Response

OK

countinteger

Total count of time off requests.

Example response

{
  "count": 1,
  "requests": [
    {
      "balance": 10,
      "balanceDiff": 1,
      "createdAt": "2022-08-26T08:32:01.640708Z",
      "id": "5b715612b079875110791111",
      "note": "Time Off Request Note",
      "policyId": "5b715612b079875110792333",
      "policyName": "Days",
      "requesterUserId": "5b715612b0798751107925555",
      "requesterUserName": "John",
      "timeUnit": "DAYS",
      "userEmail": "nicholas@clockify.com",
      "userId": "5b715612b079875110794444",
      "userName": "Nicholas",
      "userTimeZone": "Europe/Budapest",
      "workspaceId": "5b715612b079875110792222"
    }
  ]
}