v1

latestOpenAPI 3.0.02026-07-14800227.2 KB
Time off

Create a new time-off request already approved.

This endpoint creates a new time-off request for a specified _userId and existing _timeOffTypeId within a defined date range specified by the from (start) and to (end) fields. The request will be listed in the app in the Time-off history as 'submitted time off on behalf of' the person assigned to the request.

Additionally, it is possible to indicate whether the 'from' and 'to' dates are taken as full days using the optional fields partOfDayFrom and partOfDayTo, respectively. If these optional parameters are not provided, the time-off request creation defaults to full days for both the from and to dates. All requests will be made on behalf of the _userId, and the status of the request will be 'Processed' if the dates (from and to) are in the past, while if the dates are in the future, the status will be 'Submitted'.

This endpoint does not allow creating time-off requests of hourly type.

For the optimal performance of this endpoint, it supports up to 200 requests per minute. Please note, rapidly consecutive requests to this endpoint may not be processed in the submitted order. We recommend spacing out your requests for consistent processing results.

post/time-off/requests/processed

Headers

Authorizationstring required
Example:Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5rZW5qby5pbyIsInN1YiI6IjYwZjBhOTE2MjE0OTg3MjU2YmU5YzhmZiIsImF1ZCI6Imh0dHBzOi8vYXBpLmtlbmpvLmlvIiwiaWF0IjoxNjI2Mzg1MTE1LCJuYmYiOjE2MjYzODUxMTUsImV4cCI6MTYyNjU1NzkxNSwiYWNjZXNzVHlwZSI6IkFwaUFjY2VzcyIsInNfb3JnSWQiOiI2MGYwNGVhN2RmN2JhMjFlY2U0YmYzYzIifQ.cxG_7dIS-VbmDXdJuLkekoyuyCIzQG2fMcgc0nkfbWE8cihhcb5FnALbQkjU9b5-qVcEoMHZlSuUA-jMEBMMVQ

A valid bearer token.

Request body

_userIdstring required

The Kenjo employee _id.

_timeOffTypeIdstring required

The Kenjo time-off type Id of one existing time-off type.

fromstring required

The starting date of the time-off request in format YYYY-MM-DD.

tostring required

The ending date of the time-off request in format YYYY-MM-DD.

partOfDayFrom'StartOfDay' | 'HalfOfDay'

The duration of the from date. 'StartOfDay' means that the from date is the entire day. 'HalfOfDay' means that the request starts to apply in the middle of the from day. If not specified, the default value will be 'StartOfDay'.

partOfDayTo'HalfOfDay' | 'EndOfDay'

The duration of the to date. 'EndOfDay' means that the to date is the entire day. 'HalfOfDay' means the request starts to apply in the middle of the to day. If not specified, the default value will be 'EndOfDay'.

descriptionstring

The description of the time-off request. Maximun length 1000 characters.

Example request

{
  "_userId": "50a2db290da29e126a18789a",
  "_timeOffTypeId": "50a2db290da29e126a18789f",
  "from": "2020-01-26",
  "to": "2020-01-30",
  "partOfDayFrom": "StartOfDay",
  "partOfDayTo": "HalfOfDay",
  "description": "Requesting time off for personal reasons"
}

Response

CREATED

_idstring

The time off request identifier.

_userIdstring

The Kenjo employee _id.

_timeOffTypeIdstring

The Kenjo time-off type Id for an existing time-off type.

fromstring

The starting date of the time-off request in format YYYY-MM-DD.

tostring

The ending date of the time-off request in format YYYY-MM-DD.

partOfDayFrom'StartOfDay' | 'HalfOfDay'

Indicates when starts to apply the from date.

partOfDayTo'HalfOfDay' | 'EndOfDay'

Indicates when starts to apply the to date.

descriptionstring

The description of the time-off request. Maximun length 1000 characters.

Example response

{
  "_id": "50a2db290da29e126a187834",
  "_userId": "50a2db290da29e126a18789a",
  "_timeOffTypeId": "50a2db290da29e126a18789f",
  "from": "2020-01-26",
  "to": "2020-01-30",
  "partOfDayFrom": "StartOfDay",
  "partOfDayTo": "HalfOfDay",
  "description": "Requesting time off for personal reasons"
}