Update vacation request
Updates an existing vacation request. Only pending vacation requests can be updated.
What can be updated:
- Start date
- End date
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
Note: This endpoint is only available for employee accounts. Once a vacation is approved or rejected, it cannot be updated. To cancel an approved vacation, use DELETE /api/public/account/employee/vacations/.
PUT
/account/employee/vacations/{id}Authorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredRequest body
requiredapplication/jsondateFromstringrequiredVacation start date
dateTostringrequiredVacation end date
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 PUT "https://leadtime.app/api/public/account/employee/vacations/string" \
-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/string", {
method: "PUT",
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.put(
"https://leadtime.app/api/public/account/employee/vacations/string",
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