latestOpenAPI 3.0.02026-08-1284111344.5 KB

14666f4db0f8

TimeOffs

Create a new Time Off

Creates a new Time Off and returns the created Time Off object.

post/v2/timeoff

Headers

Authorizationstring required
Example:Bearer <token>

Bearer Token

Request body

techIdstring required

The tech ID to assign the time off to (prefix USR-). Use -1 to assign to all company techs.

startDatestring date-time required

The time & date when the time off starts.

endDatestring date-time required

The time & date when the time off ends.

status'approved' | 'pending' | 'declined'

The status of the time off request.

reason'Vacation' | 'Sick day' | 'Personal' | 'Company Added' | 'Other'

Reason for the time off.

detailsstring

Details about the time off.

isAllDayboolean

Whether the time off is for the entire day.

Example request

{
  "techId": "USR-38c1ee5c4efa38a4",
  "startDate": "2024-07-25 09:00:00",
  "endDate": "2024-07-25 11:00:00",
  "status": "pending",
  "reason": "Vacation",
  "details": "Doctor appointment"
}

Response

The created Time Off.

idstring

The ID of the time off.

techIdstring

The assigned tech ID (prefix USR-). Use -1 to assign to all company techs.

startDatestring date-time

The time & date when the time off starts.

endDatestring date-time

The time & date when the time off ends.

status'approved' | 'pending' | 'declined'

The status of the time off.

reason'Vacation' | 'Sick day' | 'Personal' | 'Company Added' | 'Other'

The reason for the time off.

detailsstring

Details about the time off.

isAllDayboolean

Whether the time off is for the entire day.

updatedAtstring date-time

The date and time the time off was updated.

createdAtstring date-time

The date and time the time off was created.

Example response

{
  "id": "TO-de9750285414508f",
  "techId": "USR-38c1ee5c4efa38a4",
  "startDate": "2024-07-25 09:00:00",
  "endDate": "2024-07-25 11:00:00",
  "status": "approved",
  "reason": "Vacation",
  "details": "Doctor appointment",
  "isAllDay": true,
  "updatedAt": "2024-07-25 09:00:00",
  "createdAt": "2024-07-25 09:00:00"
}