Anchor
topOfPage
topOfPage
The Time Off API is used to access, create, and modify the periods of time off taken on your business' account. The Time Off API is connected to the Staff API, as periods of time off are taken by and only apply to staff, whereas the Vacations API is used to close a location for a company-wide period of time off.




Info
titleOn this page

Table of Contents





Time Off API Endpoints

These are the endpoints that are available under the /timeOff path, which shows what hours your staff has taken off. Please note that to create new periods of time off, you POST to the /timeOffBulk path, and also note that you can view multiple time offs by simply posting a GET call to the /appointments/report path with the excludeTimeOff parameter set to false and the onlyTimeOff parameter set to 1. For more information about GET /appointments/report calls, please refer to the Appointments API page.

Endpoint

Description

GET /appointments/report

Returns an array of appointments. To get time offs to return, set the excludeTimeOff parameter to false and set the onlyTimeOff parameter to 1.

GET /timeOff/{timeOffId}Returns a JSON object for specified time off.
POST /timeOffBulk

Creates a new time off object on a business' account.

Request body/payload: Must pass a full time off object.

PUT /timeOff/{timeOffId}

Updates an existing time off object.

Request body/payload: Must pass a time off object with the desired changes made.

DELETE /timeOff/{timeOffId}Deletes a time off object from a business' account.





Time Off Parameters

There are no parameters included with time off calls.

How to Get List of Time Offs

The timeOff object is just a stripped down version of the appointment object, as both are representative of events on a staff member's schedule. The timeOffId is generally interchangeable with the calendarId in the appointments API documentation. There is no dedicated endpoint to get a list of timeOff objects, but because of the relationship between time offs and appointments, you can use the appointments endpoint GET appointments/report to retrieve a list of time offs. The three things you would need to make sure of before trying to do this are:
  1. You set the parameter onlyTimeOff to 1
  2. The parameter excludeTimeOff is set to false
  3. the serviceIdList parameter is either sent in as null or only includes ids for reasons that are of reasonType PERSONAL




Time Off API Responses


Code Block
languagejs
titleGET /timeOff/{timeOffId}
linenumberstrue
collapsetrue
{
    "businessId": 43111,
    "color": null,
    "createdDate": "2018-08-03 14:39:38",
    "createdUser": "JoeSchmo",
    "description": "Need a break!",
    "endDate": "2018-10-01",
    "endTime": 1200,
    "modifiedDate": "2018-08-07 15:10:27",
    "modifiedUser": "JoeSchmo",
    "reason": {Reason object for reason of time off-see services API page},
    "recurringAppointmentId": null,
    "staff": {Staff object for staff with time off-see staff API page},
    "startDate": "2018-10-01",
    "startTime": 1100,
    "status": "Open",
    "timeOffId": 17360947
}


Code Block
languagejs
titlePOST /timeOffBulk
linenumberstrue
collapsetrue
{
    "appliesTo": "staff",
    "assignedTo": "select",
    "businessId": "43111",
    "description": "Need a day off",
    "endDate": "2018-09-09",
    "endTime": "1300",
    "note": "Power lunch",
    "reason": {Reason object for reason of time off-see services API page},
    "repeats": false,
    "staffId": [80891],
    "startDate": "2018-09-09",
    "startTime": "1200"
}


Code Block
languagejs
titlePUT /timeOff/{timeOffId}
linenumberstrue
collapsetrue
{
    "allDay": true,
    "appliesTo": "staff",
    "businessId": 43111,
    "color": null,
    "createdDate": "2018-08-03 14:39:38",
    "createdUser": "JoeSchmo",
    "description": "Need a longer break!",
    "endDate": "2018-10-01",
    "endTime": "1400",
    "modifiedDate": "2018-08-07 11:34:56",
    "modifiedUser": "JoeSchmo",
    "note": "Need a longer break!",
    "originalStartDate": "2018-10-01",
    "reason": {Reason object for reason of time off-see services API page},
    "recurringAppointmentId": null,
    "staff": {Staff object for staff with time off-see staff API page},
    "staffId": 80891,
    "startDate": "2018-10-01",
    "startTime": "1100",
    "status": "1100",
    "timeOffId": 17360947
}
  • For the appointments report endpoint, please refer to the Appointments API page.




Time Off Object Values


Property nameTypeDescription
businessIdintegerProvides unique numeric ID of the business offering specified time off. (Required)
colorstringDisplays any color chosen to override specified time off on the backoffice calendar.
createdDatestring

Displays as date specified time off was created as YYYY-MM-DD with time after. (Required)

createdUserstringDisplays the username of user who created specified time off. (Required)
descriptionstringDisplays any description that was added to time off profile.
endDatestringDisplays the date that specified time off is set to end as YYYY-MM-DD. (Required)
endTimeintegerDisplays as military time that specified time off ends. (Required)
modifiedDatestringDisplays as date specified time off was last modified as YYYY-MM-DD with time after.
modifiedUserstringDisplays the username of user who last modified specified time off.
reasonobjectDisplays the reason object connected to specified time off. (Required)
recurringAppointmentIdintegerIf specified time off is part of a repeating appointment series, then this provides unique numeric ID of that series.
staffobjectDisplays the staff object connected to specified time off. (Required)
startDatestringDisplays the date that specified time off is set to begin as YYYY-MM-DD. (Required)
startTimeintegerDisplays as military time that specified time off is set to begin. (Required)
statusstringDisplays the status of time off. Possible values include Open, Closed, or Cancelled. (Required)
timeOffIdintegerProvides unique numeric ID of specified time off. (Required)