---
title: "Create a time-off"
method: POST
path: "/1.0/time-offs"
tags: ["Time-Offs"]
---

# Create a time-off

`POST /1.0/time-offs`

## Query parameters

- `includeFields` string[]
- `includeAllFields` boolean

## Request body

- TimeOffPublicAPIRequestEntity
  - `timeOffId` integer — The unique `identifier` of the time-off is generated by the system and used to identify the time-off globally.
  - `user` TimeOffUserPublicAPIRequestEntity, required — The time-off user.
    - `emailId` string — The user's email identifier.
    - `userId` integer — The unique identifier for the customer.
    - `firstName` string — The first name of the customer.
    - `lastName` string — The last name of the customer.
  - `note` string — The note or comment about the time-off.
  - `startDate` string, required — The time-off start date. The format for the start date is _YYYY-MM-DD_.
  - `endDate` string, 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.
  - `notifyUsers` TImeOffNotifyUsersPublicRequest — Users to notify about your time off.
    - `projectOwners` boolean — Notify project owners of projects I'm part of.
    - `others` TimeOffOtherUsersPublicRequest[] — Users to notify about your time off.
      - `userId` integer — The unique identifier for the user.
      - `emailId` string — The user's email identifier.
  - `durationInMinutes` integer — The duration of time off is determined by the type selected: if the time off type is `CUSTOM`, the `durationInMinutes` field is `required`.

## Response `201`

The resource was successfully created in the database.

- TimeOffPublicAPIResponseEntity
  - `timeOffId` integer — The unique `identifier` of the time-off is generated by the system and used to identify the time-off globally.
  - `user` TimeOffUserPublicAPIResponseEntity — The time-off user.
    - `emailId` string — The user's email identifier.
    - `userId` integer — The unique identifier for the customer.
    - `firstName` string — The first name of the customer.
    - `lastName` string — The last name of the customer.
  - `note` string — The note or comment about the time-off.
  - `startDate` string — The time-off start date. The format for the start date is _YYYY-MM-DD_.
  - `endDate` string — The time-off end date. The `endDate` must be on or after the `startDate`, formatted as _YYYY-MM-DD_.
  - `durationInMinutes` integer — 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.
  - `notifyUsers` TImeOffNotifyUsersPublicAPIResponse — Users to notify about your time off.
    - `projectOwners` boolean — Notify project owners of projects I'm part of.
    - `others` TimeOffOtherUsersPublicAPIResponse[] — Users to notify about your time off.
      - `emailId` string — The email identifier of the user.
      - `userId` integer — The user's unique, system-generated identifier, which can be used to identify the user globally.
      - `firstName` string — The first name of the user.
      - `lastName` string — The last name of the user.
  - `createdAt` integer — The timestamp when the time-off was created, represented in epoch milliseconds.
  - `createdBy` TimeOffCreatedByPublicResponse — The team member who created the time off.
    - `emailId` string — The team members email identifier.
    - `userId` integer — The unique identifier for the user.
    - `firstName` string — The first name of the user.
    - `lastName` string — The last name of the user.

## Other responses

- `400` — This error typically happens when the request payload contains an error. If you want to make sure that the request's parameters are named correctly and are the right data types, you can examine the request's syntax.
- `401` — You see this error when trying to access this resource without being authenticated. Check the API request header to make sure it is not empty and has a valid api-key that you acquired from the Rocketlane API Settings tab.
- `500` — This error denotes that there is an error that occured within our servers. The response body could help narrow down the cause for the error by our support team.

---

[API](https://skmtc.net/rocketlane/apis/rocketlane-api.md) · [All operations](https://skmtc.net/rocketlane/apis/rocketlane-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rocketlane/rocketlane-api/versions/1e8ba619e741/schema)
