v1

latestOpenAPI 3.0.12026-07-2464217456.8 KB
Time-Offs

Create a time-off

post/1.0/time-offs

Query parameters

includeFieldsstring[]

This query parameter allows you to specify which fields should be returned in the response body by selecting from the drop down. To get the relevant fields, use comma separated values. If the field is left blank, the default properties are returned.

includeAllFieldsboolean
Example:true

This query parameter allows you to specify if all the fields should be returned in the response body. If the field is left blank, the default properties are returned.

Request body

timeOffIdinteger

The unique identifier of the time-off is generated by the system and used to identify the time-off globally.

notestring

The note or comment about the time-off.

startDatestring required

The time-off start date. The format for the start date is YYYY-MM-DD.

endDatestring required

The time-off end date. The endDate must be on or after the startDate, formatted as YYYY-MM-DD.

type'FULL_DAY' | 'HALF_DAY' | 'CUSTOM' required

The type of the time-off.

durationInMinutesinteger

The duration of time off is determined by the type selected: if the time off type is CUSTOM, the durationInMinutes field is required.

Example request

{
  "timeOffId": 201,
  "user": {
    "emailId": "john.doe@rocketlane.com",
    "userId": 201,
    "firstName": "John",
    "lastName": "Doe"
  },
  "note": "Sick leave.",
  "startDate": "2023-03-28",
  "endDate": "2023-03-28",
  "type": "50",
  "notifyUsers": {
    "others": [
      {
        "userId": 201,
        "emailId": "john.doe@rocketlane.com"
      }
    ]
  },
  "durationInMinutes": 50
}

Response

The resource was successfully created in the database.

timeOffIdinteger

The unique identifier of the time-off is generated by the system and used to identify the time-off globally.

notestring

The note or comment about the time-off.

startDatestring

The time-off start date. The format for the start date is YYYY-MM-DD.

endDatestring

The time-off end date. The endDate must be on or after the startDate, formatted as YYYY-MM-DD.

durationInMinutesinteger

The durationInmMinutes per day for applied time off interval. For FULL_DAY time off, the duration is calculated as CAPACITY_IN_MINUTES / WORKING_DAYS_OF_WEEK, while for HALF_DAY time off, it is calculated as (CAPACITY_IN_MINUTES / WORKING_DAYS_OF_WEEK) / 2. These calculations are based on the user's defined capacity.

type'FULL_DAY' | 'HALF_DAY' | 'CUSTOM'

The type of the time-off.

createdAtinteger

The timestamp when the time-off was created, represented in epoch milliseconds.

Example response

{
  "timeOffId": 201,
  "user": {
    "emailId": "john.doe@rocketlane.com",
    "userId": 201,
    "firstName": "John",
    "lastName": "Doe"
  },
  "note": "Sick leave.",
  "startDate": "2023-03-28",
  "endDate": "2023-03-28",
  "durationInMinutes": 50,
  "type": "FULL_DAY",
  "notifyUsers": {
    "others": [
      {
        "emailId": "john.doe@rocketlane.com",
        "userId": 201,
        "firstName": "John",
        "lastName": "Doe"
      }
    ]
  },
  "createdAt": 1681319726000,
  "createdBy": {
    "emailId": "john.doe@rocketlane.com",
    "userId": 201,
    "firstName": "John",
    "lastName": "Doe"
  }
}