Request vacation
Creates a new vacation request for the current employee.
How vacation requests work:
- Employee submits a vacation request with start and end dates
- Request status is set to “Pending”
- Manager reviews and approves or rejects the request
- System automatically checks for scheduling conflicts
Validation rules:
- Start date cannot be more than one month in the past
- End date must be after start date
- System checks for overlapping events (other vacations, sick days, etc.)
Note: This endpoint is only available for employee accounts. Only pending vacations can be modified or canceled.
POST
/account/employee/vacations/requestAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredRequest body
requiredapplication/jsondateFromstring<date-time>requiredStart date of vacation
dateTostring<date-time>requiredEnd date of vacation
Responses
200
successbooleanrequiredOperation success flag
400Validation errors
errorsobjectShow propertiesHide properties
dateFromstring[]dateTostring[]globalErrorsstring[]messagestringstatusCodenumber401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X POST "https://leadtime.app/api/public/account/employee/vacations/request" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"dateFrom": "2024-06-01T00:00:00.000Z",
"dateTo": "2024-06-05T00:00:00.000Z"
}'const response = await fetch("https://leadtime.app/api/public/account/employee/vacations/request", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"dateFrom": "2024-06-01T00:00:00.000Z",
"dateTo": "2024-06-05T00:00:00.000Z"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/account/employee/vacations/request",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"dateFrom": "2024-06-01T00:00:00.000Z",
"dateTo": "2024-06-05T00:00:00.000Z"
},
)Response
{
"success": true
}{
"errors": {
"dateFrom": [
"Vacation start date cannot be more than one month in the past."
],
"dateTo": [
"Vacation end date must be after start date."
],
"globalErrors": [
"There are already other events for this period. Please select another one."
]
},
"message": "Bad Request",
"statusCode": 400
}Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions