Decline or cancel a vacation request
Declines a pending vacation request or cancels an approved vacation.
What this does:
- For pending requests: Changes status from “Pending” to “Rejected”
- For approved vacations: Changes status from “Approved” to “Cancelled”
- Records who declined/cancelled the request and when (statusChangedBy, statusChangedAt)
- Optionally records a reason for the decline/cancellation
- Sends a notification to the employee who requested the vacation
How it works:
- The vacation ID is provided as a URL parameter
- The optional reason can be provided in the request body
- Only managers with “manageAll” or “manageTeams” permission can decline/cancel requests
- Managers with “manageTeams” can only decline/cancel requests from employees in their teams
- Returns 404 if the vacation request is not found
- After decline/cancellation, the vacation will appear in the vacation history
Request body:
reason(optional): Text explanation for why the vacation was declined or cancelled- Example: “Insufficient coverage during this period”
- This reason will be visible in the vacation history
Use cases:
- Rejecting vacation requests that conflict with business needs
- Cancelling previously approved vacations due to changed circumstances
- Providing feedback to employees about why their request was not approved
POST
/vacations/{id}/declineAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredRequest body
requiredapplication/jsonreasonstringOptional reason explaining why the vacation request was declined or cancelled. This reason will be stored with the vacation record and visible in the vacation history. Providing a reason helps employees understand the decision and improves transparency in the approval process.
Responses
200Vacation request declined successfully
successboolean401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
404Vacation request not found
Request
curl -X POST "https://leadtime.app/api/public/vacations/string/decline" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"reason": "Insufficient coverage during this period"
}'const response = await fetch("https://leadtime.app/api/public/vacations/string/decline", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"reason": "Insufficient coverage during this period"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/vacations/string/decline",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"reason": "Insufficient coverage during this period"
},
)Response
{
"success": true
}Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions
Vacation request not found