PTO (Personal time-off)

This documentation is for LiquidPlanner New: next.liquidplanner.com

Use this endpoint to manage Personal Time Off events in the workspace.

https://next.liquidplanner.com/api/workspaces/workspace id/time-off/pto/v1

Supported Methods

POST

Add a new Personal Time Off (PTO) event to ensure work isn't scheduled when a member or a resource is not around to do it. A PTO can be created for a Member or a Resource only (not a Placeholder).

Specify the User’s ID, start date, end date and the label (i.e., the timeOffType attribute). For the PTO label, you’re able to specify one of these options: personalDay, training, vacation, travel, outOfOffice.

For example, the sample request below will add a new vacation PTO for the specified user:

curl --location --request POST 'https://next.liquidplanner.com/api/workspaces/<workspace id>/time-off/pto/v1' \
--header 'Authorization: Bearer <API Token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "timeOffType": "vacation",
    "startDate": "2023-03-15",
    "endDate": "2023-03-19",
    "userId": <id of the member or resource>
}'

UPDATE

Send a PUT request to update an existing PTO by using the PTO id.

For example, the below request will update the dates on an existing PTO event:

curl --location --request PUT 'https://next.liquidplanner.com/api/workspaces/<workspace id>/time-off/pto/v1/<PTO id> \
--header 'Authorization: Bearer <API Token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "startDate": "2023-03-10",
    "endDate": "2023-03-20"
}'

GET

Pull a list of all PTOs from the workspace.

curl --location --request GET 'https://next.liquidplanner.com/api/workspaces/<workspace id>/time-off/pto/v1' \
--header 'Authorization: Bearer <API Token>' \

Sample Response

{
    "recordLimit": 500,
    "recordCount": 1,
    "data": [
        {
            "id": 5787,
            "timeOffType": "vacation",
            "startDate": "2023-03-10",
            "endDate": "2023-03-20",
            "userId": 390,
            "createdAt": "2022-10-21T06:23:04.215912Z",
            "updatedAt": "2022-10-21T06:36:38.212Z",
            "createdById": 185,
            "updatedById": 185,
            "workspaceId": 21,
            "organizationId": 21
        }
    ]
}

Filter Options

Apply the filter string to the endpoint URL. Values are case sensitive for enum strings as noted below.

Filter attributeField typeDescriptionFilter stringNote
userIdnumberPull PTOs for a specific user?userId[is]="390"
startDatedatePull PTOs by their start date?startDate[before]="2023-01-01"
endDatedatePull PTOs by their start date?endDate[after]="2023-01-01"
timeOffTypeenum string (training, vacation, travel, outOfOffice, personalDay)Pull PTOs by their time off type?timeOffType[is]="vacation"Values are case sensitive