Update holiday year
Updates the validity period (validTill) of a custom holiday year configuration.
What this does: Changes how long a custom holiday configuration applies to future years. This is useful when you want to extend or limit the scope of your customizations.
How validTill works:
-
Set to a specific year (e.g.,
2026): The configuration applies from the year’s start year through 2026- Future years within this range will be automatically created as “derived” configurations
- Years beyond
validTillwill use default holidays
-
Set to
null: The configuration applies indefinitely to all future years- All future years will automatically inherit this configuration as “derived” years
- Useful for permanent company holidays that should always apply
Example scenarios:
-
Temporary change: You add a special holiday for 2024-2025 only
- Create year 2024 with
validTill: 2025 - Both 2024 and 2025 will use the custom configuration
- 2026 and beyond will use defaults
- Create year 2024 with
-
Permanent company holiday: You add “Company Foundation Day” that should always be a holiday
- Create year 2024 with
validTill: null - All future years will automatically include this holiday
- Create year 2024 with
-
Extending validity: You previously set
validTill: 2025but want to extend to 2027- Update the year with
validTill: 2027 - Years 2026 and 2027 will now also use the custom configuration
- Update the year with
Note: This endpoint only works on custom holiday years (those with an id). Default years cannot be updated - you must create a custom year first using POST /holidays/years.
/holidays/years/{yearId}AuthorizationOAuth2 access token · headerrequiredapi:writeAuthorizationBearer token (JWT) · headerrequiredyearIdstringrequiredapplication/jsonvalidTillobjectrequiredcurl -X PUT "https://leadtime.app/api/public/holidays/years/string" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"validTill": 2026
}'const response = await fetch("https://leadtime.app/api/public/holidays/years/string", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"validTill": 2026
})
});import requests
response = requests.put(
"https://leadtime.app/api/public/holidays/years/string",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"validTill": 2026
},
)