Time offs

List all time-off types

const leaveTypes = await ft.timeOffs.types();
  • Returns a Promise that resolves to an Array of Freshteam.models.LeaveType objects

Get time-off type by ID

const leaveType = await ft.timeOffs.type(id);
  • Returns a Promise that resolves to a Freshteam.models.LeaveType object

List all time-off requests

const leaveReqList = await ft.timeOffs.list(query);

Create a time-off

const newLeaveReq = await ft.timeOffs.create(leaveRequest);
  • Returns a Promise that resolves to a Freshteam.models.LeaveRequest object
  • The first argument is an object of type Freshteam.models.LeaveRequestCreate

Get time-off by ID

const leave = await ft.timeOffs.get(id);
  • Returns a Promise that resolves to a Freshteam.models.LeaveRequest object

Approve time-off by ID

const res = await ft.timeOffs.approve(id, options);
  • Returns a Promise that resolves to null if request was successful
  • The second argument is an object of type Freshteam.models.LeaveRequestApprove

Reject time-off by ID

const res = await ft.timeOffs.reject(id, options);
  • Returns a Promise that resolves to null if request was successful
  • The second argument is an object of type Freshteam.models.LeaveRequestReject

Cancel time-off by ID

const res = await ft.timeOffs.cancel(id);
  • Returns a Promise that resolves to null if request was successful
Last Updated: